cmd/docker: enable cobra completion descriptions
This patch enables descriptions on the CLI completion script. It used to be disabled due to the CLI historically not supporting cobra v2 completions, as seen by this patch https://github.com/docker/cli/commit/cbec75e2f3f5afd3334db693829a6b150612076c. As an escape hatch, the user can set the `DOCKER_CLI_DISABLE_COMPLETION_DESCRIPTION` environment variable to disable the completion description when generating the completion file with `docker completion <fish|bash|zsh>`. Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
This commit is contained in:
@@ -158,7 +158,7 @@ func newPluginCommand(dockerCli *command.DockerCli, plugin *cobra.Command, meta
|
||||
CompletionOptions: cobra.CompletionOptions{
|
||||
DisableDefaultCmd: false,
|
||||
HiddenDefaultCmd: true,
|
||||
DisableDescriptions: true,
|
||||
DisableDescriptions: os.Getenv("DOCKER_CLI_DISABLE_COMPLETION_DESCRIPTION") != "",
|
||||
},
|
||||
}
|
||||
opts, _ := cli.SetupPluginRootCommand(cmd)
|
||||
|
||||
Reference in New Issue
Block a user