integrii / flaggy

Idiomatic Go input parsing with subcommands, positional values, and flags at any position. No required project or package layout and no external dependencies.
The Unlicense
856 stars 30 forks source link

How to explicitly print subcommand help #76

Open kahunacohen opened 2 years ago

kahunacohen commented 2 years ago

How do I explicitly print out a subcommand's help text (usage)?

craftyguy commented 2 years ago

this works for me:

$ foo bar -h

where bar is the subcommand

integrii commented 2 years ago

Currently you can show help on a flaggy.Parser, but not a flaggy.Subcommand. I agree that it would be nice to call help on a flaggy.Subcommand directly, but it would take a little re-factoring to prevent duplicate code... Right now this is done via a template rendering that happens on the Parser...