-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: break out required and optional flags in subcommand help #262
feat: break out required and optional flags in subcommand help #262
Conversation
k3llymariee
commented
May 10, 2024
if strings.Contains(p.Value.Description, "Deprecated") { | ||
continue | ||
} |
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.
sneaking this in here as i noticed we had some deprecated flags in the cli
{{WrappedOptionalFlagUsages . | trimTrailingWhitespaces}} | ||
|
||
Global Flags: | ||
{{rpad " -h, --help" 29}} Help for this command |
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.
it felt weird to include this within the "optional" flags, even though it's not technically a global flag it kinda is? lmk if we want to move this somewhere else
cmd/templates.go
Outdated
} | ||
|
||
func init() { | ||
cobra.AddTemplateFunc("WrappedRequiredFlagUsages", WrappedRequiredFlagUsages) |
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.
Could you move these to Execute()
so we don't use init()
?
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.
oh yup!