Skip to content

Stop parsing earlier when a catch-all argument is present#333

Merged
natecook1000 merged 2 commits into
mainfrom
nate/repeated_flag_with_catchall
Jul 2, 2021
Merged

Stop parsing earlier when a catch-all argument is present#333
natecook1000 merged 2 commits into
mainfrom
nate/repeated_flag_with_catchall

Conversation

@natecook1000
Copy link
Copy Markdown
Member

@natecook1000 natecook1000 commented Jun 29, 2021

If a command defines an @Argument property with the .unconditionalRemaining parsing strategy, we need to stop parsing input when we encounter either a positional argument or an unrecognized option/flag label. Note that this is a change in behavior, as seen in the modified test.

Resolves #331.

Checklist

  • I've added at least one test that validates that my change is working, if appropriate
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

If a command defines an @argument property with the .unconditionalRemaining
parsing strategy, we need to stop parsing input when we encounter either a
positional argument or an unrecognized option/flag label. Note that this is
a change in behavior, as seen in the modified test.

Resolves #331.
@natecook1000 natecook1000 added the breaking change A change that would impact existing library users label Jun 29, 2021
@natecook1000 natecook1000 requested a review from Azoy June 29, 2021 22:04
@natecook1000
Copy link
Copy Markdown
Member Author

@swift-ci Please test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change A change that would impact existing library users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ArgumentParser is not handling as expected option commands with the same name.

2 participants