google / subcommands

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

API to print usage should be public, so commands can invoke it #15

Closed charles-dyfis-net closed 6 years ago

charles-dyfis-net commented 6 years ago

If a command requires positional arguments, it can be necessary and appropriate to print usage.

Right now, relevant API calls such as explain() are private. There should be some mechanism for a subcommand to validate its argument list and invoke this package's existing mechanisms for generating help/usage should those positional arguments be incorrect.

charles-dyfis-net commented 6 years ago

On further reflection, it appears that the expectation is for flags.Usage() to be useful enough to serve the purpose. This is... workable?