[AUTOMATED] fix(cli): decompile-rejects-subcommand-help — every subcommand answers -h/--help - #448
Merged
Merged
Conversation
…mmand answers -h/--help Asking a command to describe itself is the first thing anyone does with an unfamiliar CLI, and four of kuna's sixteen subcommands answered it with an error: $ kuna decompile --help error: unknown option --help # exit 2 `test` and `catalog` said the same; `kuna specs` forwarded its argv to slacomp, which owns no help flag, and answered `Unknown option: --help` with exit 1 — a different message and a different code, which is why sweeping for the reported string found three of the four rather than all four. `-h` was broken in a quieter way in the same four: it does not start with `--`, so it never reached the unknown-option arm and was read as a positional, producing `decompile requires <binary> and <func>` and `unexpected argument "-h"`. All four now carry the `-h | --help` arm the other twelve already had, each printing its own multi-line usage block rather than the one-line summary `kuna --help` already had for it: the report asked to discover decompile's flags, and that one-liner names no --assert vocabulary, no --define-function contract and no --json shape. One more defect had to be closed for the promoted regression probe to run at all. `verify.vendorable()` admits a probe that needs no binary, and --promote vendored this acceptance on that basis, but `clitests.run_one()` re-derived a stricter rule of its own and refused it, so the probe failed `make test-cli` the moment it landed. Every probe promoted before this one carried a binary, so the disagreement had never fired. clitests now calls vendorable() instead of duplicating it. Argument parsing ahead of any load: no engine source, no option, no stages case, no catalog counter. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
#448 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Asking a command to describe itself is the first thing anyone does with an
unfamiliar CLI, and four of
kuna's sixteen subcommands answered it with anerror. Two testers filed the same report against
decompile;test,catalogand
specssat one command away with the same defect.The other twelve subcommands each print a usage block and exit 0.
The fix
-h | --helparm the twelve already had, added to the four that lacked it:decompile.rs,main.rs'scmd_testandcmd_catalog, andspecs.rsaheadof the
slacomppassthrough (slacomp owns no help flag, so the alias has todescribe itself).
kuna --helpalready carried for it. The report asked to "discover decompile flags through
subcommand help", and the one-liner names no
--assertvocabulary, no--define-functioncontract and no--jsonshape.scripts/repipe/clitests.pynow asksverify.vendorable()whether a promotedprobe can run instead of re-deriving a stricter rule of its own. The two had
disagreed, harmlessly until now:
vendorable()admits a probe that needs nobinary,
clitestsdemandedtarget.binary_source == "in-repo"and refused one.kuna decompile --helpis the first binary-less probe the corpus has held, soit failed
make test-clithe moment it was promoted.Tests
tests/cli/decompile-rejects-subcommand-help.jsonis the promoted acceptanceprobe.
decompiler/crates/kuna-cli/tests/subcommand_help.rs(5 tests) asserts thecontract over the whole dispatch table rather than the reported case — exit 0,
its own usage block, no binary and no
.slarequired, the repaired blocks namingthe flags that were being looked for, and an unknown option still exiting 2. Four
of the five fail without the fix; the fifth is the guard that the new arm did not
swallow a real usage error, and passes either way.
Gates:
make test675/675 PARITY OK ·make test-stages635/635 PARITY OK ·make rust-testgreen ·make check-specOK ·make test-cli42/42 (41/42 withthe probe promoted and
clitestsunchanged) ·kuna catalog --checkOK.🤖 Generated with Claude Code