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

Have optional subcommands take priority over positional arguments #299

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

peterebden
Copy link
Contributor

As illustrated in the test case, if there's an optional subcommand but the parent command also takes positional arguments, the subcommand is never selected. This PR alters the order of checks so it is preferred over filling in a positional argument.

I suppose this probably represents a slightly suboptimal flag design in the first place since it implies some ambiguity, but we found ourselves there nonetheless :(

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.

1 participant