-
Notifications
You must be signed in to change notification settings - Fork 4
Description
This is a potential feature but probably warrants a little research before implementing it. I'm thinking it could be more intuitive to search up the subcommand tree (I'm currently adding support for multi-level subcommands) for options that aren't matched by the current subcommand. For example, if we have these commands:
dylan [--verbose --debug] new workspace [other options]
dylan [--verbose --debug] new library [other options]then currently one has to invoke like this: dylan --verbose new workspace --blah my-project
The idea is to allow this as well: dylan new workspace --verbose --blah my-project
My thinking is that this puts less burden on the end-user to remember which part of the command defines the --verbose flag. I should note that this idea originally came from the "fallthrough" option here, where they went literally insane with options.
If there were any conflict (e.g., the new or the workspace subcommand accepted its own --verbose flag) then obviously the nearer one would take precedence, but (a) that should be very rare and (b) don't design your command line that way.
I did check Python argparse and they do not appear to support this feature. They parse the way we currently do.