climax
climax copied to clipboard
Formalize global/subcommand architecture.
Be opinionated about the following architecture:
cmd
# global options
-v -q
# subcommand
doSomething
# subcommand options
-foo=bar
-bar=baz
Right now all commands are "equal" and this gets pretty confusing when one command might do something that should be mutually exclusive from another (hence the need for subcommands/subprograms).
Also the idea here is to be strict about where global options and subcommand options go, so that there's no confusion about how to specify things. This is slightly less flexible than allowing flags to be called before or after things, but it eliminates the hard-to-parse situations of flags after "arguments" and also detecting where "the rest of the arguments" are and how those are passed around.
Starting to play around with ideas for this refactor on https://github.com/apinstein/climax/tree/subcommand-refactor