Files
designcraft/apps
Hamza b5196b933d test(cli): pin what the argument parser does today (photocraft#7071)
The argument surface had no tests of its own, so the three bugs #7071 lists
could come back without anything noticing. These pin what the parser does:
help in all three spellings, an unknown command, the version, `<sub> --help`
for every subcommand, the options that take a value, the repeatable flags, a
flag that takes no value leaving the next token alone, and a missing value
naming its option.

Carries the review fix: asking for help about a command nobody has is still
an unknown command. usage_for fell back to the whole usage block when it
described no such subcommand, so `bogus --help` printed it on stdout and
exited 0, skipping the failure the test beside it asserts. It answers None
instead -- the usage block names every subcommand, so no second list can
drift from the match that dispatches them.

Rebased onto the post-split main, on top of the rebased #1478. The CLI's
tests live under tests/it/ now, so args.rs went there and is registered in
tests/it/main.rs.

One case needed updating rather than porting: this pinned that an automation
root given twice was an error. Upstream has since made the roots repeatable
(`...` in the usage), so every use adds a folder. The test now pins that --
which is what "what the parser does today" means -- and says so, rather than
holding the parser to behaviour it has deliberately left behind.
2026-10-28 18:36:37 +05:00
..