mirror of
https://github.com/storytold/designcraft.git
synced 2026-11-16 07:12:43 +00:00
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.