You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[parser] Int long option with empty = value (--opt=) consumes the next argv #1302
For Int long options, an empty inline value (--opt=) is not distinguished from "no = at all": the parser falls through and consumes the next argv as the value. The shared parser's own String branch handles this correctly via has_inline_value; the Int branch only checks value.empty().
Evidence (harness vs GNU, two runs)
grep --max-count= -e x f
GNU: grep: invalid max count, exit 2 (rejects the empty value itself).
WinuxCmd: grep: invalid argument '-e' for '--max-count' — the error names -e, proving -e was consumed as the max-count value.
Scope note (probe-tested counter-evidence): head --lines= 5 f behaves correctly in WinuxCmd (head: invalid number of lines: '', rc1, identical to GNU) — head is shielded by its dispatcher rewrite hook. The defect is in the shared Int path and surfaces on commands that use it directly (grep proven).
Source
src/core/opt.cppm Int branch (~L266-291): if (!value.empty()) uses the inline value, otherwise consumes the next argv; empty inline value is indistinguishable from absent. String branch (~L293-306) uses has_inline_value correctly. Single-dash-long Int has the same shape (~L380-400).
Regression seed
grep --max-count= -e x f → expect grep: invalid max count rc2 (and specifically an error about the empty value, not about -e).
Found by the full-audit (argument-form deep audit).
Activity
Merge pull request #1417 from unixwin/fix/iss-parser-cluster