mirror of https://github.com/docker/cli.git
cli/command/container: NewRunCommand: slight cleanup of completion
- explicitly suppress unhandled errors - remove names for unused arguments Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
ce4469a696
commit
eed0e5b02a
|
@ -70,22 +70,13 @@ func NewRunCommand(dockerCli command.Cli) *cobra.Command {
|
||||||
command.AddTrustVerificationFlags(flags, &options.untrusted, dockerCli.ContentTrustEnabled())
|
command.AddTrustVerificationFlags(flags, &options.untrusted, dockerCli.ContentTrustEnabled())
|
||||||
copts = addFlags(flags)
|
copts = addFlags(flags)
|
||||||
|
|
||||||
cmd.RegisterFlagCompletionFunc(
|
_ = cmd.RegisterFlagCompletionFunc("env", func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective) {
|
||||||
"env",
|
|
||||||
func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
|
||||||
return os.Environ(), cobra.ShellCompDirectiveNoFileComp
|
return os.Environ(), cobra.ShellCompDirectiveNoFileComp
|
||||||
},
|
})
|
||||||
)
|
_ = cmd.RegisterFlagCompletionFunc("env-file", func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective) {
|
||||||
cmd.RegisterFlagCompletionFunc(
|
|
||||||
"env-file",
|
|
||||||
func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
|
||||||
return nil, cobra.ShellCompDirectiveDefault
|
return nil, cobra.ShellCompDirectiveDefault
|
||||||
},
|
})
|
||||||
)
|
_ = cmd.RegisterFlagCompletionFunc("network", completion.NetworkNames(dockerCli))
|
||||||
cmd.RegisterFlagCompletionFunc(
|
|
||||||
"network",
|
|
||||||
completion.NetworkNames(dockerCli),
|
|
||||||
)
|
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue