Skip to content

Formalize global/subcommand architecture. #2

@apinstein

Description

@apinstein

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions