@@ -36,6 +36,7 @@ func setupCommonRootCommand(rootCmd *cobra.Command) (*cliflags.ClientOptions, *p
36
36
cobra .AddTemplateFunc ("invalidPluginReason" , invalidPluginReason )
37
37
cobra .AddTemplateFunc ("isPlugin" , isPlugin )
38
38
cobra .AddTemplateFunc ("isExperimental" , isExperimental )
39
+ cobra .AddTemplateFunc ("displayHelpLink" , displayHelpLink )
39
40
cobra .AddTemplateFunc ("decoratedName" , decoratedName )
40
41
41
42
rootCmd .SetUsageTemplate (usageTemplate )
@@ -185,7 +186,6 @@ var helpCommand = &cobra.Command{
185
186
if cmd == nil || e != nil || len (args ) > 0 {
186
187
return errors .Errorf ("unknown help topic: %v" , strings .Join (args , " " ))
187
188
}
188
-
189
189
helpFunc := cmd .HelpFunc ()
190
190
helpFunc (cmd , args )
191
191
return nil
@@ -205,6 +205,10 @@ func isExperimental(cmd *cobra.Command) bool {
205
205
return experimental
206
206
}
207
207
208
+ func displayHelpLink (cmd * cobra.Command ) bool {
209
+ return ! cmd .HasParent ()
210
+ }
211
+
208
212
func isPlugin (cmd * cobra.Command ) bool {
209
213
return cmd .Annotations [pluginmanager .CommandAnnotationPlugin ] == "true"
210
214
}
@@ -360,6 +364,9 @@ Invalid Plugins:
360
364
361
365
Run '{{.CommandPath}} COMMAND --help' for more information on a command.
362
366
{{- end}}
367
+ {{- if displayHelpLink .}}
368
+ To get more help with docker, check out guides at https://docs.docker.com/go/guides.md
369
+ {{- end}}
363
370
`
364
371
365
372
var helpTemplate = `
0 commit comments