diff --git a/command/check.go b/command/check.go index 461aa11b5..922d7bccc 100644 --- a/command/check.go +++ b/command/check.go @@ -131,10 +131,11 @@ func (c *AgentCheckCommand) checkClientHealth(clientStats map[string]string, min } func (c *AgentCheckCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-min-peers": complete.PredictAnything, - "-min-servers": complete.PredictAnything, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-min-peers": complete.PredictAnything, + "-min-servers": complete.PredictAnything, + }) } func (c *AgentCheckCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/client_config.go b/command/client_config.go index 6f2b082c5..4fa8c2f85 100644 --- a/command/client_config.go +++ b/command/client_config.go @@ -112,10 +112,11 @@ func (c *ClientConfigCommand) Run(args []string) int { } func (c *ClientConfigCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-servers": complete.PredictNothing, - "-update-servers": complete.PredictNothing, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-servers": complete.PredictNothing, + "-update-servers": complete.PredictNothing, + }) } func (c *ClientConfigCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/deployment_fail.go b/command/deployment_fail.go index 8d357e3ba..f7625a9c3 100644 --- a/command/deployment_fail.go +++ b/command/deployment_fail.go @@ -43,10 +43,11 @@ func (c *DeploymentFailCommand) Synopsis() string { } func (c *DeploymentFailCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-detach": complete.PredictNothing, - "-verbose": complete.PredictNothing, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-detach": complete.PredictNothing, + "-verbose": complete.PredictNothing, + }) } func (c *DeploymentFailCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/deployment_list.go b/command/deployment_list.go index ddb40b05e..1a0703a8f 100644 --- a/command/deployment_list.go +++ b/command/deployment_list.go @@ -37,11 +37,12 @@ List Options: } func (c *DeploymentListCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-json": complete.PredictNothing, - "-t": complete.PredictAnything, - "-verbose": complete.PredictNothing, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-json": complete.PredictNothing, + "-t": complete.PredictAnything, + "-verbose": complete.PredictNothing, + }) } func (c *DeploymentListCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/deployment_pause.go b/command/deployment_pause.go index fa996431c..4efb6a0aa 100644 --- a/command/deployment_pause.go +++ b/command/deployment_pause.go @@ -36,9 +36,10 @@ func (c *DeploymentPauseCommand) Synopsis() string { } func (c *DeploymentPauseCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-verbose": complete.PredictNothing, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-verbose": complete.PredictNothing, + }) } func (c *DeploymentPauseCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/deployment_promote.go b/command/deployment_promote.go index 7723ab639..2bdf03cd7 100644 --- a/command/deployment_promote.go +++ b/command/deployment_promote.go @@ -52,11 +52,12 @@ func (c *DeploymentPromoteCommand) Synopsis() string { } func (c *DeploymentPromoteCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-group": complete.PredictAnything, - "-detach": complete.PredictNothing, - "-verbose": complete.PredictNothing, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-group": complete.PredictAnything, + "-detach": complete.PredictNothing, + "-verbose": complete.PredictNothing, + }) } func (c *DeploymentPromoteCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/deployment_resume.go b/command/deployment_resume.go index eaf58a90c..6d3224638 100644 --- a/command/deployment_resume.go +++ b/command/deployment_resume.go @@ -41,10 +41,11 @@ func (c *DeploymentResumeCommand) Synopsis() string { } func (c *DeploymentResumeCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-detach": complete.PredictNothing, - "-verbose": complete.PredictNothing, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-detach": complete.PredictNothing, + "-verbose": complete.PredictNothing, + }) } func (c *DeploymentResumeCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/deployment_status.go b/command/deployment_status.go index 596bd1b9c..1d34733f6 100644 --- a/command/deployment_status.go +++ b/command/deployment_status.go @@ -43,11 +43,12 @@ func (c *DeploymentStatusCommand) Synopsis() string { } func (c *DeploymentStatusCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-verbose": complete.PredictNothing, - "-json": complete.PredictNothing, - "-t": complete.PredictAnything, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-verbose": complete.PredictNothing, + "-json": complete.PredictNothing, + "-t": complete.PredictAnything, + }) } func (c *DeploymentStatusCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/eval_status.go b/command/eval_status.go index 3bdf137bd..261195548 100644 --- a/command/eval_status.go +++ b/command/eval_status.go @@ -49,12 +49,13 @@ func (c *EvalStatusCommand) Synopsis() string { } func (c *EvalStatusCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-json": complete.PredictNothing, - "-monitor": complete.PredictNothing, - "-t": complete.PredictAnything, - "-verbose": complete.PredictNothing, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-json": complete.PredictNothing, + "-monitor": complete.PredictNothing, + "-t": complete.PredictAnything, + "-verbose": complete.PredictNothing, + }) } func (c *EvalStatusCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/fs.go b/command/fs.go index 79109dac8..de1dd8c2b 100644 --- a/command/fs.go +++ b/command/fs.go @@ -80,16 +80,17 @@ func (f *FSCommand) Synopsis() string { } func (c *FSCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-H": complete.PredictNothing, - "-verbose": complete.PredictNothing, - "-job": complete.PredictAnything, - "-stat": complete.PredictNothing, - "-f": complete.PredictNothing, - "-tail": complete.PredictNothing, - "-n": complete.PredictAnything, - "-c": complete.PredictAnything, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-H": complete.PredictNothing, + "-verbose": complete.PredictNothing, + "-job": complete.PredictAnything, + "-stat": complete.PredictNothing, + "-f": complete.PredictNothing, + "-tail": complete.PredictNothing, + "-n": complete.PredictAnything, + "-c": complete.PredictAnything, + }) } func (f *FSCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/inspect.go b/command/inspect.go index 90ee59539..28f56c4e0 100644 --- a/command/inspect.go +++ b/command/inspect.go @@ -42,11 +42,12 @@ func (c *InspectCommand) Synopsis() string { } func (c *InspectCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-version": complete.PredictAnything, - "-json": complete.PredictNothing, - "-t": complete.PredictAnything, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-version": complete.PredictAnything, + "-json": complete.PredictNothing, + "-t": complete.PredictAnything, + }) } func (c *InspectCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/job_deployments.go b/command/job_deployments.go index 13c4f61f0..84fcc8ee0 100644 --- a/command/job_deployments.go +++ b/command/job_deployments.go @@ -44,12 +44,13 @@ func (c *JobDeploymentsCommand) Synopsis() string { } func (c *JobDeploymentsCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-json": complete.PredictNothing, - "-t": complete.PredictAnything, - "-latest": complete.PredictNothing, - "-verbose": complete.PredictNothing, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-json": complete.PredictNothing, + "-t": complete.PredictAnything, + "-latest": complete.PredictNothing, + "-verbose": complete.PredictNothing, + }) } func (c *JobDeploymentsCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/job_dispatch.go b/command/job_dispatch.go index 68c031048..12a320c5d 100644 --- a/command/job_dispatch.go +++ b/command/job_dispatch.go @@ -57,11 +57,12 @@ func (c *JobDispatchCommand) Synopsis() string { } func (c *JobDispatchCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-meta": complete.PredictAnything, - "-detach": complete.PredictNothing, - "-verbose": complete.PredictNothing, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-meta": complete.PredictAnything, + "-detach": complete.PredictNothing, + "-verbose": complete.PredictNothing, + }) } func (c *JobDispatchCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/job_history.go b/command/job_history.go index bcc09ca95..c36fcf32a 100644 --- a/command/job_history.go +++ b/command/job_history.go @@ -55,13 +55,14 @@ func (c *JobHistoryCommand) Synopsis() string { } func (c *JobHistoryCommand) Autocompleteflags() complete.Flags { - return complete.Flags{ - "-p": complete.PredictNothing, - "-full": complete.PredictNothing, - "-version": complete.PredictAnything, - "-json": complete.PredictNothing, - "-t": complete.PredictAnything, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-p": complete.PredictNothing, + "-full": complete.PredictNothing, + "-version": complete.PredictAnything, + "-json": complete.PredictNothing, + "-t": complete.PredictAnything, + }) } func (c *JobHistoryCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/job_promote.go b/command/job_promote.go index b6fa01d0d..102454b7f 100644 --- a/command/job_promote.go +++ b/command/job_promote.go @@ -53,11 +53,12 @@ func (c *JobPromoteCommand) Synopsis() string { } func (c *JobPromoteCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-group": complete.PredictAnything, - "-detach": complete.PredictNothing, - "-verbose": complete.PredictNothing, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-group": complete.PredictAnything, + "-detach": complete.PredictNothing, + "-verbose": complete.PredictNothing, + }) } func (c *JobPromoteCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/job_revert.go b/command/job_revert.go index 1100621e3..e74208a83 100644 --- a/command/job_revert.go +++ b/command/job_revert.go @@ -41,10 +41,11 @@ func (c *JobRevertCommand) Synopsis() string { } func (c *JobRevertCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-detach": complete.PredictNothing, - "-verbose": complete.PredictNothing, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-detach": complete.PredictNothing, + "-verbose": complete.PredictNothing, + }) } func (c *JobRevertCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/keyring.go b/command/keyring.go index 0714f61d0..52581561e 100644 --- a/command/keyring.go +++ b/command/keyring.go @@ -158,12 +158,13 @@ func (c *KeyringCommand) Synopsis() string { } func (c *KeyringCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-install": complete.PredictAnything, - "-list": complete.PredictNothing, - "-remove": complete.PredictAnything, - "-use": complete.PredictAnything, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-install": complete.PredictAnything, + "-list": complete.PredictNothing, + "-remove": complete.PredictAnything, + "-use": complete.PredictAnything, + }) } func (c *KeyringCommand) AutocompleteArgs() complete.Predictor { return complete.PredictNothing diff --git a/command/logs.go b/command/logs.go index 81b1555aa..e3bd12120 100644 --- a/command/logs.go +++ b/command/logs.go @@ -62,15 +62,16 @@ func (l *LogsCommand) Synopsis() string { } func (c *LogsCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-stderr": complete.PredictNothing, - "-verbose": complete.PredictNothing, - "-job": complete.PredictAnything, - "-f": complete.PredictNothing, - "-tail": complete.PredictAnything, - "-n": complete.PredictAnything, - "-c": complete.PredictAnything, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-stderr": complete.PredictNothing, + "-verbose": complete.PredictNothing, + "-job": complete.PredictAnything, + "-f": complete.PredictNothing, + "-tail": complete.PredictAnything, + "-n": complete.PredictAnything, + "-c": complete.PredictAnything, + }) } func (l *LogsCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/node_drain.go b/command/node_drain.go index b8140e218..e3ca2492b 100644 --- a/command/node_drain.go +++ b/command/node_drain.go @@ -46,12 +46,13 @@ func (c *NodeDrainCommand) Synopsis() string { } func (c *NodeDrainCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-disable": complete.PredictNothing, - "-enable": complete.PredictNothing, - "-self": complete.PredictNothing, - "-yes": complete.PredictNothing, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-disable": complete.PredictNothing, + "-enable": complete.PredictNothing, + "-self": complete.PredictNothing, + "-yes": complete.PredictNothing, + }) } func (c *NodeDrainCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/node_status.go b/command/node_status.go index ebe888087..a6eee88fa 100644 --- a/command/node_status.go +++ b/command/node_status.go @@ -86,15 +86,16 @@ func (c *NodeStatusCommand) Synopsis() string { } func (c *NodeStatusCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-allocs": complete.PredictNothing, - "-json": complete.PredictNothing, - "-self": complete.PredictNothing, - "-short": complete.PredictNothing, - "-stats": complete.PredictNothing, - "-t": complete.PredictAnything, - "-verbose": complete.PredictNothing, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-allocs": complete.PredictNothing, + "-json": complete.PredictNothing, + "-self": complete.PredictNothing, + "-short": complete.PredictNothing, + "-stats": complete.PredictNothing, + "-t": complete.PredictAnything, + "-verbose": complete.PredictNothing, + }) } func (c *NodeStatusCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/operator_raft_list.go b/command/operator_raft_list.go index 1fb395f6b..874d2cc82 100644 --- a/command/operator_raft_list.go +++ b/command/operator_raft_list.go @@ -34,9 +34,10 @@ List Peers Options: } func (c *OperatorRaftListCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-stale": complete.PredictAnything, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-stale": complete.PredictAnything, + }) } func (c *OperatorRaftListCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/operator_raft_remove.go b/command/operator_raft_remove.go index 9f8c21d40..792cb188a 100644 --- a/command/operator_raft_remove.go +++ b/command/operator_raft_remove.go @@ -38,9 +38,10 @@ Remove Peer Options: } func (c *OperatorRaftRemoveCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-peer-address": complete.PredictAnything, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-peer-address": complete.PredictAnything, + }) } func (c *OperatorRaftRemoveCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/plan.go b/command/plan.go index daccab501..5a0052909 100644 --- a/command/plan.go +++ b/command/plan.go @@ -79,10 +79,11 @@ func (c *PlanCommand) Synopsis() string { } func (c *PlanCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-diff": complete.PredictNothing, - "-verbose": complete.PredictNothing, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-diff": complete.PredictNothing, + "-verbose": complete.PredictNothing, + }) } func (c *PlanCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/run.go b/command/run.go index 41bcdf432..6e8e00549 100644 --- a/command/run.go +++ b/command/run.go @@ -98,13 +98,14 @@ func (c *RunCommand) Synopsis() string { } func (c *RunCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-check-index": complete.PredictNothing, - "-detach": complete.PredictNothing, - "-verbose": complete.PredictNothing, - "-vault-token": complete.PredictAnything, - "-output": complete.PredictNothing, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-check-index": complete.PredictNothing, + "-detach": complete.PredictNothing, + "-verbose": complete.PredictNothing, + "-vault-token": complete.PredictAnything, + "-output": complete.PredictNothing, + }) } func (c *RunCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/server_members.go b/command/server_members.go index efd8922b0..247378b71 100644 --- a/command/server_members.go +++ b/command/server_members.go @@ -37,9 +37,10 @@ Server Members Options: } func (c *ServerMembersCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-detailed": complete.PredictNothing, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-detailed": complete.PredictNothing, + }) } func (c *ServerMembersCommand) AutocompleteArgs() complete.Predictor { diff --git a/command/stop.go b/command/stop.go index 59bc31e93..8992608c8 100644 --- a/command/stop.go +++ b/command/stop.go @@ -52,12 +52,13 @@ func (c *StopCommand) Synopsis() string { } func (c *StopCommand) AutocompleteFlags() complete.Flags { - return complete.Flags{ - "-detach": complete.PredictNothing, - "-purge": complete.PredictNothing, - "-yes": complete.PredictNothing, - "-verbose": complete.PredictNothing, - } + return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), + complete.Flags{ + "-detach": complete.PredictNothing, + "-purge": complete.PredictNothing, + "-yes": complete.PredictNothing, + "-verbose": complete.PredictNothing, + }) } func (c *StopCommand) AutocompleteArgs() complete.Predictor {