google / subcommands

Go subcommand library.
Apache License 2.0
749 stars 48 forks source link

Feature Request: Allow hidden commands #40

Open pshoroff opened 2 years ago

pshoroff commented 2 years ago

I work for a team at Google that uses this package. It's a command line tool oriented at other Googlers and but we often find ourselves wanting to use the same binary for developer-only tasks that are not displayed to users through the help command.

Carrotman42 commented 2 years ago

One can approximate this by creating a "hidden" command group (pass "hidden" as the group during the call to commander.Register) and overriding the Commander.ExplainGroup function to suppress output when requested to print out the "hidden" group.