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

Expose terminal subcommand #75

Closed mattwiller closed 2 years ago

mattwiller commented 3 years ago

For use cases where only the final subcommand in the sequence needs to be run (e.g. git remote add just runs the add subcommand of remote), it would be useful to identify that subcommand directly. Since that pointer is already helpfully stored in the parser, simply exposing it via a method worked nicely.