-
Notifications
You must be signed in to change notification settings - Fork 937
fix: Update cli usage template for cobra feature parity #1463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax seems fine but if you could quickly tidy up the template that would be nice 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as well, just some cleanup 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. My bad for missing a few of these cases!
How does the template not have excessive newlines when sections are omitted? Is there something cleaning that up? The Cobra one has to put conditional blocks on the same line to (what I assume) prevent the extra newlines: https://github.com/spf13/cobra/blob/master/command.go#L502-L525 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh it's the {{-
got it
This PR updates the custom usage template for feature parity with the default template used in Cobra.
I've restored the custom heading names and colorization.
Changes:
This is partially related to #1233 and #1403, but as suggested by @jsjoeio, split into a separate PR.
Fixes #1423
Example:
