apple / apple/swift-argument-parser
--opt= silently collapses to a bare flag and consumes the following token (short -o= behaves differently)
- Dominant language
- Swift
- Stars
- 3.8k
- Forks
- 411
- Avg merge
- 7d 14h
- Merged PRs (30d)
- 15
Description
## Description
`ParsedArgument.init(_:)` (`Sources/ArgumentParser/Parsing/SplitArguments.swift`, ~lines 21–31) collapses an empty value after `=` into a bare flag:
```swift
let indexOfEqualSign = str.firstIndex(of: "=") ?? str.endIndex
let (baseName, value) = (str[..
Contributor guide
Research direction
Start in Sources/ArgumentParser/Parsing/SplitArguments.swift, especially ParsedArgument.init(_:) around lines 21–31 and the short-option handling around lines 743–750. Trace parseIndividualArg and popNextElementIfValue(after:), then add regression coverage for ["--out=", "file.txt"] and ["-o=", "file.txt"]. Done means both forms preserve an explicitly empty value and leave file.txt positional.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100