A path named help or h runs the help instead of the command, so check help --require-signature FPR passes #198

Open
opened 2026-10-13 14:22:27 +02:00 by clawbot · 1 comment
Collaborator

A path or URL named help or h runs urfave/cli's built-in help instead of the command, which prints the command's help and exits 0, even after --. So mfer check help --require-signature FPR checks nothing and passes, and mfer gen help and mfer freshen help write nothing. Every command in internal/cli/mfer.go gets the built-in help subcommand by default, and urfave/cli treats a first argument of help or h as that subcommand. Separately, mfer check DIR --help fails with No help topic for 'DIR' instead of printing check's help (the same happens on the --help DIR order). Found in the review of #197.

Reproduce on next (8f7170b): mkdir help; echo x > help/x.txt; mfer gen help prints generate's help and writes no manifest; mfer check help --require-signature <any fingerprint> exits 0.

Severity: major. A directory named help or h is never checked, and the check still passes.

Correct: help and h given to gen, check, freshen, fetch, list or export are paths or URLs like any other; --help (-h) anywhere on a command prints that command's help; mfer help and mfer help CMD keep working at the top level.

Definition of done

  • Failing tests first, through the CLI: gen help writes help/index.mf; check help on an unsigned manifest with --require-signature exits 1; check DIR --help and check --help DIR print check's help and exit 0; mfer help check still prints it.
  • The fix in internal/cli/mfer.go.
  • make check passes.

Model: opus-5-5

A path or URL named `help` or `h` runs urfave/cli's built-in help instead of the command, which prints the command's help and exits 0, even after `--`. So `mfer check help --require-signature FPR` checks nothing and passes, and `mfer gen help` and `mfer freshen help` write nothing. Every command in `internal/cli/mfer.go` gets the built-in `help` subcommand by default, and urfave/cli treats a first argument of `help` or `h` as that subcommand. Separately, `mfer check DIR --help` fails with `No help topic for 'DIR'` instead of printing `check`'s help (the same happens on the `--help DIR` order). Found in the review of https://git.eeqj.de/sneak/mfer/pulls/197. Reproduce on `next` (8f7170b): `mkdir help; echo x > help/x.txt; mfer gen help` prints `generate`'s help and writes no manifest; `mfer check help --require-signature <any fingerprint>` exits 0. Severity: major. A directory named `help` or `h` is never checked, and the check still passes. Correct: `help` and `h` given to `gen`, `check`, `freshen`, `fetch`, `list` or `export` are paths or URLs like any other; `--help` (`-h`) anywhere on a command prints that command's help; `mfer help` and `mfer help CMD` keep working at the top level. ## Definition of done - Failing tests first, through the CLI: `gen help` writes `help/index.mf`; `check help` on an unsigned manifest with `--require-signature` exits 1; `check DIR --help` and `check --help DIR` print `check`'s help and exit 0; `mfer help check` still prints it. - The fix in `internal/cli/mfer.go`. - `make check` passes. Model: opus-5-5
clawbot self-assigned this 2026-10-13 14:22:27 +02:00
Author
Collaborator

#211 makes help and h arguments on gen, check, freshen, fetch, list and export, and makes --help print the command's help wherever it appears.

Model: opus-5-5

https://git.eeqj.de/sneak/mfer/pulls/211 makes `help` and `h` arguments on `gen`, `check`, `freshen`, `fetch`, `list` and `export`, and makes `--help` print the command's help wherever it appears. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/mfer#198