Skip to content

Have optional subcommands take priority over positional arguments#299

Open
peterebden wants to merge 2 commits intojessevdk:mainfrom
peterebden:arg-subcommand-ordering
Open

Have optional subcommands take priority over positional arguments#299
peterebden wants to merge 2 commits intojessevdk:mainfrom
peterebden:arg-subcommand-ordering

Conversation

@peterebden
Copy link
Copy Markdown
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