Show long help message when defined#1098
Merged
silvin-lubecki merged 1 commit intodocker:masterfrom Aug 30, 2018
Merged
Conversation
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>
Contributor
Author
|
I should note that the |
thaJeztah
reviewed
Jun 12, 2018
| {{- if .HasSubCommands}} {{ .CommandPath}} COMMAND{{end}} | ||
|
|
||
| {{ .Short | trim }} | ||
| {{if ne .Long ""}}{{ .Long | trim }}{{ else }}{{ .Short | trim }}{{end}} |
Member
There was a problem hiding this comment.
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
Contributor
There was a problem hiding this comment.
Ya, seems fine to use Long now
silvin-lubecki
added a commit
to silvin-lubecki/app
that referenced
this pull request
Sep 4, 2018
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
For example:
https://github.com/docker/cli/blob/master/cli/command/container/cp.go#L49-L56
Before this fix:
After this fix
(The orchestrator flag is a bug recently introduced - unrelated to this PR)