Skip to content

Conversation

@shakefu
Copy link
Contributor

@shakefu shakefu commented Apr 11, 2019

When you have a subparser or subcommand configured, the environment variable and config file support breaks the argparse parsing of the arguments.

['--opt', 'subcommand', '--config-opt'] must be like ['--opt', '--config-opt', 'subcommand'] if --config-opt is set at the top level parser, or it throws an error.

Switching the order of the env-var and config-file parsed arguments to be prepended fixes this issue. It should not cause any other issues, since positional vars are not able to bet set through environment or config files.

@shakefu
Copy link
Contributor Author

shakefu commented Apr 11, 2019

@ronhanson @bw2 Please take a look at this and see if it works for you. Let me know if you want to rebase and squash these commits. Thanks!

@ronhanson
Copy link
Contributor

Seems good to me. @bw2 should we merge?

@shakefu
Copy link
Contributor Author

shakefu commented Jul 31, 2019

Any word if this can be merged?

@bw2 bw2 merged commit 726ac12 into bw2:master Oct 8, 2019
@bw2
Copy link
Owner

bw2 commented Oct 8, 2019

Sorry for taking so long to get to this.

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

Successfully merging this pull request may close these issues.

3 participants