-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Automate flag grouping with and abstraction #342
Conversation
Sample output:
|
rootCmd.PersistentFlags().IntVarP(&logger.Level, "verbose", "v", 3, "set log level, use 0 to silence, 4 for debugging and 5 for debugging with AWS debug logging") | ||
rootCmd.PersistentFlags().BoolVarP(&logger.Color, "color", "C", true, "toggle colorized logs") | ||
|
||
rootCmd.SetUsageFunc(g.Usage) |
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.
We have to set this here, setting it at each subcommand's level doesn't actually work, although it's not clear why from the implementation.
ffd4fe3
to
9a81392
Compare
3492179
to
8836783
Compare
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
8836783
to
1eb2e5e
Compare
1eb2e5e
to
71d1bef
Compare
Description
This is a follow-up to @mumoshu's change, allowing us to easily implement flag grouping for all commands. This is also changes the grouping itself (as discussed in #328), and introduces a custom function for rendering the usage text, so we are in full control of it.
Checklist
make build
)make test
)