- Notifications
You must be signed in to change notification settings - Fork928
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
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 👍
Uh oh!
There was an error while loading.Please reload this page.
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!
Emyrk commentedMay 16, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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
Uh oh!
There was an error while loading.Please reload this page.
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:
