fix(parser): keep terminator tail positional - #21
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 13, 2026, 5:25 AM ET / 09:25 UTC. ClawSweeper reviewWhat this changesThis PR changes command parsing so tokens after a bare Merge readinessKeep this owner-authored PR open for normal merge review. The patch cleanly makes a bare terminator positional while preserving explicitly selected remaining-option behavior, with focused regression coverage. Likely related people: steipete (high-confidence parser-area contributor). Priority: P2 Review scores
Verification
How this fits togetherCommander tokenizes CLI arguments, then groups them into positional values, options, and flags for command resolution. The terminator branch determines whether later raw tokens are treated as positional input or option-owned input. flowchart LR
A[CLI argument tail] --> B[Tokenizer]
B --> C[Command parser]
C --> D{Bare terminator}
D --> E[Positional tail]
C --> F[Explicit remaining option]
F --> G[Raw option tail]
E --> H[Parsed command values]
G --> H
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep bare-terminator handling independent of options, retain Do we have a high-confidence way to reproduce the issue? Yes. Current main visibly routes Is this the best way to solve the issue? Yes. Removing only the implicit terminator-to-option branch is the narrowest maintainable fix and preserves the documented explicit remaining-option path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e23983764748. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Summary
--positionalremainingoption to be selected explicitly before it owns the raw tailWhy
CommandParserpreviously routed a terminator tail into the first declaredremainingoption even when the user never selected that option. That made--act like an implicit option invocation instead of only ending option parsing.Proof
swiftformat --lint .swiftlint lint --config .swiftlint.yml --strictswift test --parallel— 65 tests passedswift build -c release— warning-free on Swift 6.4