Skip to content

Commit

Permalink
backport of commit 0748918 (#18919)
Browse files Browse the repository at this point in the history
Co-authored-by: Dave May <[email protected]>
  • Loading branch information
hc-github-team-nomad-core and davemay99 authored Oct 30, 2023
1 parent b625eec commit d88be0c
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .changelog/18901.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
cli: Add file prediction for operator raft/snapshot commands
```
2 changes: 1 addition & 1 deletion command/operator_raft_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (c *OperatorRaftInfoCommand) AutocompleteFlags() complete.Flags {
}

func (c *OperatorRaftInfoCommand) AutocompleteArgs() complete.Predictor {
return complete.PredictNothing
return complete.PredictFiles("*")
}

func (c *OperatorRaftInfoCommand) Synopsis() string {
Expand Down
2 changes: 1 addition & 1 deletion command/operator_raft_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (c *OperatorRaftLogsCommand) AutocompleteFlags() complete.Flags {
}

func (c *OperatorRaftLogsCommand) AutocompleteArgs() complete.Predictor {
return complete.PredictNothing
return complete.PredictFiles("*")
}

func (c *OperatorRaftLogsCommand) Synopsis() string {
Expand Down
6 changes: 4 additions & 2 deletions command/operator_raft_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ Options:
}

func (c *OperatorRaftStateCommand) AutocompleteFlags() complete.Flags {
return complete.Flags{}
return complete.Flags{
"-last-index": complete.PredictNothing,
}
}

func (c *OperatorRaftStateCommand) AutocompleteArgs() complete.Predictor {
return complete.PredictNothing
return complete.PredictFiles("*")
}

func (c *OperatorRaftStateCommand) Synopsis() string {
Expand Down
2 changes: 1 addition & 1 deletion command/operator_snapshot_inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (c *OperatorSnapshotInspectCommand) AutocompleteFlags() complete.Flags {
}

func (c *OperatorSnapshotInspectCommand) AutocompleteArgs() complete.Predictor {
return complete.PredictNothing
return complete.PredictFiles("*.snap")
}

func (c *OperatorSnapshotInspectCommand) Synopsis() string {
Expand Down
2 changes: 1 addition & 1 deletion command/operator_snapshot_restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (c *OperatorSnapshotRestoreCommand) AutocompleteFlags() complete.Flags {
}

func (c *OperatorSnapshotRestoreCommand) AutocompleteArgs() complete.Predictor {
return complete.PredictNothing
return complete.PredictFiles("*.snap")
}

func (c *OperatorSnapshotRestoreCommand) Synopsis() string {
Expand Down
2 changes: 1 addition & 1 deletion command/operator_snapshot_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (c *OperatorSnapshotStateCommand) AutocompleteFlags() complete.Flags {
}

func (c *OperatorSnapshotStateCommand) AutocompleteArgs() complete.Predictor {
return complete.PredictNothing
return complete.PredictFiles("*.snap")
}

func (c *OperatorSnapshotStateCommand) Synopsis() string {
Expand Down

0 comments on commit d88be0c

Please sign in to comment.