🤔 Background
bashunit::main::cmd_watch (src/main/subcommands.sh) special-cases only -f/--filter as consuming a value. Every other option's value falls through to the positional branch and becomes the watched path.
Verified on main:
$ bashunit watch --tag slow tests/unit/consolebashunit --watch polling: slow (every 2s)Error: no such path: 'slow'.
The tag's value became the path, and the real path was handed to --tag. Unit-level it is clearer still — cmd_watch --tag slow tests/ produces slow --tag tests/.
The loud case only got loud because of the path validation added in #1263. The quiet case remains: whenever an option's value happens to name a real directory, watch polls that directory and drops the option, reporting nothing. bashunit watch --report-junit tests polls tests and writes no report.
Documented as "put the path first", but an option that silently repurposes its value as a different argument is the shape #871 already removed from the test parser.
💡 Proposal
Give watch the set of options cmd_test consumes a value for, so it forwards flag and value together and only a true positional becomes the path.
The set belongs in one shared predicate rather than a second hardcoded list that can drift. An anti-drift test can derive the truth from cmd_test's own parser: an option takes a value there precisely when its case arm ends in an unconditional shift.
🤔 Background
bashunit::main::cmd_watch(src/main/subcommands.sh) special-cases only-f/--filteras consuming a value. Every other option's value falls through to the positional branch and becomes the watched path.Verified on
main:The tag's value became the path, and the real path was handed to
--tag. Unit-level it is clearer still —cmd_watch --tag slow tests/producesslow --tag tests/.The loud case only got loud because of the path validation added in #1263. The quiet case remains: whenever an option's value happens to name a real directory,
watchpolls that directory and drops the option, reporting nothing.bashunit watch --report-junit testspollstestsand writes no report.Documented as "put the path first", but an option that silently repurposes its value as a different argument is the shape #871 already removed from the test parser.
💡 Proposal
Give
watchthe set of optionscmd_testconsumes a value for, so it forwards flag and value together and only a true positional becomes the path.The set belongs in one shared predicate rather than a second hardcoded list that can drift. An anti-drift test can derive the truth from
cmd_test's own parser: an option takes a value there precisely when its case arm ends in an unconditionalshift.