Skip to content

Allow single, attached value with .upToNextOption#610

Merged
natecook1000 merged 1 commit intomainfrom
option-tied-insufficient
Dec 13, 2023
Merged

Allow single, attached value with .upToNextOption#610
natecook1000 merged 1 commit intomainfrom
option-tied-insufficient

Conversation

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