Do not display help link if env var “DOCKER_HIDE_HELP_GUIDES” is set

Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
This commit is contained in:
Guillaume Tardif 2020-12-01 15:12:09 +01:00
parent dbd65f92c7
commit 2369d9d126
1 changed files with 3 additions and 2 deletions

View File

@ -206,7 +206,8 @@ func isExperimental(cmd *cobra.Command) bool {
} }
func displayHelpLink(cmd *cobra.Command) bool { func displayHelpLink(cmd *cobra.Command) bool {
return !cmd.HasParent() hideGuides := os.Getenv("DOCKER_HIDE_HELP_GUIDES") != ""
return !cmd.HasParent() && !hideGuides
} }
func isPlugin(cmd *cobra.Command) bool { func isPlugin(cmd *cobra.Command) bool {
@ -365,7 +366,7 @@ Invalid Plugins:
Run '{{.CommandPath}} COMMAND --help' for more information on a command. Run '{{.CommandPath}} COMMAND --help' for more information on a command.
{{- end}} {{- end}}
{{- if displayHelpLink .}} {{- if displayHelpLink .}}
To get more help with docker, check out guides at https://docs.docker.com/go/guides.md To get more help with docker, check out guides at https://docs.docker.com/go/guides/
{{- end}} {{- end}}
` `