for i := 0; i < len(args); i++ appears in 39 command bodies and "requires a value" 42 times. Each loop decides on its own whether an unknown --flag is an error (read.go:231), a positional (issue.go:153) or silently swallowed (mr.go:794). mr review --approve --bogus reports repository --bogus as not found instead of a usage error. Usage strings and parsers are written separately and can disagree.
Remedy: one parseFlags(args, spec) (pos, vals, code) in control.go, with Usage derived from the spec. This also unlocks table-driven unit tests for command parsing.
closed by commit 94884a2232 by cmc: control: one flag parser for every command
2026-09-04 01:05 UTC