Skip to content

Commit 375d9a4

Browse files
author
Daniel Hiltgen
committed
Show long help message when defined
This fixes the help template so that if a command includes a Long form help message that is displayed instead of ignoring it and always showing the Short message. Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
1 parent 31d99ba commit 375d9a4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cli/cobra.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ var usageTemplate = `Usage:
104104
{{- if not .HasSubCommands}} {{.UseLine}}{{end}}
105105
{{- if .HasSubCommands}} {{ .CommandPath}} COMMAND{{end}}
106106
107-
{{ .Short | trim }}
107+
{{if ne .Long ""}}{{ .Long | trim }}{{ else }}{{ .Short | trim }}{{end}}
108108
109109
{{- if gt .Aliases 0}}
110110

0 commit comments

Comments
 (0)