Skip to content
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 error message for @Option array without values #434

Closed
2 tasks done
natecook1000 opened this issue Mar 25, 2022 · 1 comment
Closed
2 tasks done

Incorrect error message for @Option array without values #434

natecook1000 opened this issue Mar 25, 2022 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@natecook1000
Copy link
Member

natecook1000 commented Mar 25, 2022

The error message when giving an option label, but no values, is incorrect for @Option array properties. For example, with this command:

@main
struct Example: ParsableCommand {
  @Option(parsing: .upToNextOption)
  var test: [String] = []

  mutating func run() throws {
    print(test)
  }
}

Expected behavior

$ example --test
Error: Missing value for '--test <test>'

Actual behavior

$ example --test
Error: Unknown option '--test'. Did you mean '--test'?

Checklist

  • If possible, I've reproduced the issue using the main branch of this package
  • I've searched for existing GitHub issues

ArgumentParser version: main
Swift version: swift-driver version: 1.45.2 Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8)

@natecook1000 natecook1000 added bug Something isn't working good first issue Good for newcomers labels Mar 25, 2022
@natecook1000
Copy link
Member Author

Fixed by #435.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant