Skip to content

Allow single, attached value with .upToNextOption #610

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

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

natecook1000
Copy link
Member

Fixes an issue where a single attached value triggered an error on .upToNextOption options.

Fixes #609.

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

Fixes an issue where a single attached value triggered an error on
`.upToNextOption` options.

Fixes #609.
@natecook1000
Copy link
Member Author

@swift-ci Please test

@natecook1000 natecook1000 enabled auto-merge (squash) December 12, 2023 23:16
@natecook1000 natecook1000 merged commit a3d53a7 into main Dec 13, 2023
@natecook1000 natecook1000 deleted the option-tied-insufficient branch December 13, 2023 01:30
james-fletcher-01 added a commit to james-fletcher-01/swift-argument-parser that referenced this pull request Mar 29, 2025
…alues

Issue apple#434 reported that when a label, but no values, are provided for an array @option property, the error message incorrectly signifies a missing option instead of a missing value. PR apple#435 fixed this for .upToNextOption arrays, but the bug remained for .allRemainingInput arrays.

In addition to tests for verifying the error message, this also adds tests to verify that an attached value counts for the validation. This was a regression for .upToNextOption introduced in apple#435 and fixed in apple#610.
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.

Extra values required with --option=value and .upToNextOption
1 participant