Skip to content

Capture values across multiple .upToNextOption option uses#304

Merged
natecook1000 merged 1 commit into
mainfrom
nate/array_parsing
May 15, 2021
Merged

Capture values across multiple .upToNextOption option uses#304
natecook1000 merged 1 commit into
mainfrom
nate/array_parsing

Conversation

@natecook1000
Copy link
Copy Markdown
Member

This fixes a bug where an @Option array defined with the .upToNextOption parsing strategy would only capture the last "group" of elements. e.g. in:

example --test one two --test three four

the --test property would only have the value ["three", "four"].

Fixes rdar://73908471

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

This fixes a bug where an @option array defined with the .upToNextOption
parsing strategy would only capture the last "group" of elements. e.g. in:

    example --test one two --test three four

the `--test` property would only have the value `["three", "four"]`.

Fixes rdar://73908471
@natecook1000 natecook1000 added the breaking change A change that would impact existing library users label May 14, 2021
@natecook1000
Copy link
Copy Markdown
Member Author

natecook1000 commented May 14, 2021

Note, this isn't source breaking, but changes the behavior of existing CLI tools. For options defined like @Option(parsing: .upToNextOption) var names: [String] = [], the following is no longer a valid use of the command:

$ example --names --other-flag

@natecook1000
Copy link
Copy Markdown
Member Author

@swift-ci Please test

@natecook1000 natecook1000 merged commit c002f40 into main May 15, 2021
@natecook1000 natecook1000 deleted the nate/array_parsing branch May 15, 2021 02:39
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.

1 participant