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
Incorrect handling of arguments with the same property name #322
Comments
Just ran into this issue between a few public struct ExampleOption: ParsableArguments {
@Option(name: [.customLong("foo")])
var _valueExampleOption: Int // Add a prefix _ and a suffix of the type name
public var value: Int { _valueExampleOption }
public init() {}
} This let me preserve the usage of |
Yeah, I've had the same issue as @bscothern with regards to having two If anyone has any pointers on where to start and/or the appropriate section to add a test case, I'm happy to investigate. |
I've tracked down the source of the bug, and have a PR at #495. If you want to test out my solution, my fix is in the following branch on my fork of the project: |
Swift argument parser doesn't handle properties with the same name under different option groups gracefully.
The following snippet throws an error when run with no arguments, but I would expect no required arguments:
Output:
ArgumentParser version:
0.4.3
Swift version:
Checklist
main
branch of this packageThe text was updated successfully, but these errors were encountered: