Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/cobra.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ var usageTemplate = `Usage:
{{- if not .HasSubCommands}} {{.UseLine}}{{end}}
{{- if .HasSubCommands}} {{ .CommandPath}} COMMAND{{end}}

{{ .Short | trim }}
{{if ne .Long ""}}{{ .Long | trim }}{{ else }}{{ .Short | trim }}{{end}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this was changed in https://github.com/moby/moby/pull/23825/files#diff-4a2b6f090171fe18f7406cb69fb2e479R143

The original template was;

{{with or .Long .Short }}{{. | trim}}{{end}}{{if gt .Aliases 0}}

In a later PR, man-page generation was moved to external markdown files; moby/moby#26830, but the template wasn't updated with that change, so I think it's ok to use the long description again (if present)

ping @dnephin to double check

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya, seems fine to use Long now


{{- if gt .Aliases 0}}

Expand Down