Skip to content
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

Reporting of persistent flags in help #2040

Open
fjl opened this issue Jan 6, 2025 · 0 comments
Open

Reporting of persistent flags in help #2040

fjl opened this issue Jan 6, 2025 · 0 comments
Labels
area/v3 relates to / is being considered for v3 status/triage maintainers still need to look into this

Comments

@fjl
Copy link
Contributor

fjl commented Jan 6, 2025

As I am continuing work on converting our app to cli v3, I noticed that persistent flags in help for subcommands do not show the categories. Our app has a lot of 'global options' which are shared by all subcommands, and very few local flags on the commands themselves. So showing the global options correctly is essential.

At this time, for --help on a subcommand, inherited flags are shown as a plain list, under the heading GLOBAL OPTIONS. It can't be changed in the template either, since there is no method on command to retrieve the categories.

The two resolutions I see are:

  • adding a method like: VisibleGlobalFlagCategories to Command. Then I could re-implement the listing by overriding the template.
  • same as above, but put this feature in the default template.
@fjl fjl added area/v3 relates to / is being considered for v3 status/triage maintainers still need to look into this labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/v3 relates to / is being considered for v3 status/triage maintainers still need to look into this
Projects
None yet
Development

No branches or pull requests

1 participant