diff --git a/.changelog/18901.txt b/.changelog/18901.txt new file mode 100644 index 000000000..21d438919 --- /dev/null +++ b/.changelog/18901.txt @@ -0,0 +1,3 @@ +```release-note:improvement +cli: Add file prediction for operator raft/snapshot commands +``` diff --git a/command/operator_raft_info.go b/command/operator_raft_info.go index 4ce1be54d..032fa20a2 100644 --- a/command/operator_raft_info.go +++ b/command/operator_raft_info.go @@ -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 { diff --git a/command/operator_raft_logs.go b/command/operator_raft_logs.go index 0816f65f9..9cda5d53d 100644 --- a/command/operator_raft_logs.go +++ b/command/operator_raft_logs.go @@ -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 { diff --git a/command/operator_raft_state.go b/command/operator_raft_state.go index 3d8f844df..c16de8bd1 100644 --- a/command/operator_raft_state.go +++ b/command/operator_raft_state.go @@ -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 { diff --git a/command/operator_snapshot_inspect.go b/command/operator_snapshot_inspect.go index 5d609cf8f..10d076528 100644 --- a/command/operator_snapshot_inspect.go +++ b/command/operator_snapshot_inspect.go @@ -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 { diff --git a/command/operator_snapshot_restore.go b/command/operator_snapshot_restore.go index 966417cd5..2b80f1d70 100644 --- a/command/operator_snapshot_restore.go +++ b/command/operator_snapshot_restore.go @@ -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 { diff --git a/command/operator_snapshot_state.go b/command/operator_snapshot_state.go index c03ae3831..3f0ccdaa3 100644 --- a/command/operator_snapshot_state.go +++ b/command/operator_snapshot_state.go @@ -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 {