-
Notifications
You must be signed in to change notification settings - Fork 326
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
Optional arrays #317
base: main
Are you sure you want to change the base?
Optional arrays #317
Conversation
@natecook1000 Hey, could you validate this draft? struct Rugby: ParsableCommand {
@Option(parsing: .upToNextOption) var focus: [String]?
func run() throws { print(focus) }
} Command | Output
---------------------------------------------------------------------------------
rugby | nil
rugby --focus | []
rugby --focus Alamofire SnapKit | ["Alamofire", "SnapKit"] |
@swift-ci please test |
Thanks for this, @swiftyfinch — I'm not totally convinced that this is the right design to solve this issue, but it does seem sensible. Can you make sure the behavior makes sense / add tests for using this with the other parsing strategies? We'll also want an initializer that works with non- |
@natecook1000 Okey, I will try) How can I run checks with @swift-ci? |
@swiftyfinch I think only committers can kick off CI… Just let me know when you're ready for review! |
@natecook1000 Ready for review |
@swift-ci Please test |
@natecook1000 I fixed compile error. Please, run tests again. |
@swift-ci please test |
@natecook1000 @kylemacomber Hey, any updates here? |
Any updates? |
@natecook1000 @kylemacomber Hey, do I need to resolve conflicts or this solution doesn't have a chance to be merged? |
Bumping this, as this feature would be nice. |
Bumping this. |
It's the solution for issue #307
The author closed the issue, but I still need this one.
Checklist
Didn't find any documentation about using arrays in Option properties.