Skip to content

[AUTOMATED] fix(cli): decompile-rejects-subcommand-help — every subcommand answers -h/--help - #448

Merged
mahaloz merged 2 commits into
mainfrom
feat/re-decompile-rejects-subcommand-help
Sep 6, 2026
Merged

[AUTOMATED] fix(cli): decompile-rejects-subcommand-help — every subcommand answers -h/--help#448
mahaloz merged 2 commits into
mainfrom
feat/re-decompile-rejects-subcommand-help

Conversation

@mahaloz

@mahaloz mahaloz commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

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. Two testers filed the same report against decompile; test, catalog
and specs sat one command away with the same defect.

$ kuna decompile --help
error: unknown option --help
$ echo $?
2

$ kuna decompile -h                 # -h does not start with `--`, so it was a positional
error: decompile requires <binary> and <func>
$ kuna catalog -h
error: unexpected argument "-h"
$ kuna specs --help                 # forwarded straight to slacomp
Unknown option: --help

The other twelve subcommands each print a usage block and exit 0.

The fix

  • The -h | --help arm the twelve already had, added to the four that lacked it:
    decompile.rs, main.rs's cmd_test and cmd_catalog, and specs.rs ahead
    of the slacomp passthrough (slacomp owns no help flag, so the alias has to
    describe itself).
  • Each prints its own multi-line block, not the one-line summary kuna --help
    already carried for it. The report asked to "discover decompile flags through
    subcommand help", and the one-liner names no --assert vocabulary, no
    --define-function contract and no --json shape.
  • scripts/repipe/clitests.py now asks verify.vendorable() whether a promoted
    probe 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 no
    binary, clitests demanded target.binary_source == "in-repo" and refused one.
    kuna decompile --help is the first binary-less probe the corpus has held, so
    it failed make test-cli the moment it was promoted.

Tests

tests/cli/decompile-rejects-subcommand-help.json is the promoted acceptance
probe. decompiler/crates/kuna-cli/tests/subcommand_help.rs (5 tests) asserts the
contract over the whole dispatch table rather than the reported case — exit 0,
its own usage block, no binary and no .sla required, the repaired blocks naming
the 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 test 675/675 PARITY OK · make test-stages 635/635 PARITY OK ·
make rust-test green · make check-spec OK · make test-cli 42/42 (41/42 with
the probe promoted and clitests unchanged) · kuna catalog --check OK.

🤖 Generated with Claude Code

mahaloz and others added 2 commits September 6, 2026 05:49
…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>
@mahaloz mahaloz added the full-ci Run the full cargo workspace suite on this PR before merge (internal PRs skip it by default) label Sep 6, 2026
@mahaloz
mahaloz merged commit aaf0e97 into main Sep 6, 2026
10 of 11 checks passed
@mahaloz
mahaloz deleted the feat/re-decompile-rejects-subcommand-help branch September 6, 2026 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Run the full cargo workspace suite on this PR before merge (internal PRs skip it by default)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant