add global flags to autocomplete
This commit is contained in:
parent
35f5c8f2dd
commit
ed2a544502
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue