-
Notifications
You must be signed in to change notification settings - Fork 352
Closed
Description
When an option is declared with the .upToNextOption parsing strategy, using a "tied" value isn't sufficient enough to satisfy the parser. For example, with this command declaration:
import ArgumentParser
@main
struct Example: ParsableCommand {
@Option(name: .shortAndLong, parsing: .upToNextOption)
var count: [Int] = []
mutating func run() throws {
print(count)
}
}The option requires at least one non-tied value:
$ example --count=1 1
[1, 1]
$ example --count=1
Error: Missing value for '--count <count>'
Help: --count <count>
Usage: example [--count <count> ...]
See 'example --help' for more information.
ArgumentParser version: 1.3.0
Swift version: Apple Swift version 5.11-dev (LLVM fe9a485647a386d, Swift e395df3ef372fd4)
Checklist
- If possible, I've reproduced the issue using the
mainbranch of this package - I've searched for existing GitHub issues
Metadata
Metadata
Assignees
Labels
No labels