Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow parent command options to be parsed in sub-commands #40

Open
mwatts15 opened this issue Dec 30, 2021 · 0 comments
Open

Allow parent command options to be parsed in sub-commands #40

mwatts15 opened this issue Dec 30, 2021 · 0 comments

Comments

@mwatts15
Copy link
Contributor

mwatts15 commented Dec 30, 2021

The cli_command_wrapper module allows for making the command interface (i.e., OWM and sub-commands) accessible through a command line interface. This interface presents attributes and parameters as command line options, but requires that options which are defined by a "super-command" to precede the introduction of any sub-command. This is, sometimes, inconvenient since we may realize the need for a super-command's options only after we've typed out most of the command, so we have to navigate back to the earlier command to add the options.

Method parameters from super-commands' __call__ methods should not be available on sub-commands under this proposal: this allows to segregate options that only make sense for specific methods from those that are potentially applicable throughout sub-commands.

Recommended approach: define parsers just for options derived from properties and attributes to pass down to the current parser and any sub-parsers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant