Every command read options only up to its first argument (StopOnNthArg set to 1, kept from urfave/cli v2 in the move to v3), and check, fetch, freshen, list and export ignored anything after that argument. So mfer check DIR --require-signature FPR passed an unsigned manifest, and mfer fetch URL --dest D wrote into the current directory.
internal/cli/mfer.go drops that setting from every command, so options are read wherever they appear and -- still ends them. The five one-argument commands get urfave/cli's ArgValidator hook, which refuses a second argument with unexpected argument "b" before the command does anything. gen takes several paths and changes only in where it reads options; version still ignores arguments.
The tests run each case from the issue through the CLI.
Worth knowing:
TestFlagAfterArgumentIsArgument asserted the defect (gen DIR -v read -v as a path). The gen -- -x test replaces it. No other existing test needed a change.
urfave/cli still stops reading options at an argument named help (its built-in subcommand) or at a - followed by a non-letter, such as -5. In the one-argument commands that leaves a second argument, which is refused; in gen the rest are read as paths.
A mistyped command followed by an option, mfer bogus -x, now reports the unknown option instead of the unknown command.
Model: opus-5-5
Fixes https://git.eeqj.de/sneak/mfer/issues/196.
Every command read options only up to its first argument (`StopOnNthArg` set to 1, kept from urfave/cli v2 in the move to v3), and `check`, `fetch`, `freshen`, `list` and `export` ignored anything after that argument. So `mfer check DIR --require-signature FPR` passed an unsigned manifest, and `mfer fetch URL --dest D` wrote into the current directory.
`internal/cli/mfer.go` drops that setting from every command, so options are read wherever they appear and `--` still ends them. The five one-argument commands get urfave/cli's `ArgValidator` hook, which refuses a second argument with `unexpected argument "b"` before the command does anything. `gen` takes several paths and changes only in where it reads options; `version` still ignores arguments.
The tests run each case from the issue through the CLI.
Worth knowing:
- `TestFlagAfterArgumentIsArgument` asserted the defect (`gen DIR -v` read `-v` as a path). The `gen -- -x` test replaces it. No other existing test needed a change.
- urfave/cli still stops reading options at an argument named `help` (its built-in subcommand) or at a `-` followed by a non-letter, such as `-5`. In the one-argument commands that leaves a second argument, which is refused; in `gen` the rest are read as paths.
- A mistyped command followed by an option, `mfer bogus -x`, now reports the unknown option instead of the unknown command.
Model: opus-5-5
Every command read options only up to its first argument, and check,
fetch, freshen, list and export dropped everything after it, so
`check DIR --require-signature FPR` passed an unsigned manifest. Options
are now read wherever they appear, as urfave/cli v3 does by default, and
`--` still ends them. Those five commands refuse a second argument,
naming it.
TestFlagAfterArgumentIsArgument asserted the defect (`gen DIR -v` read
`-v` as a path); a test that `gen -- -x` reads `-x` as a path replaces it.
Model: opus-5-5
Judgement call: a first argument of help or h still runs the built-in help and exits 0 instead of the command, even after --, so mfer check h --require-signature FPR checks nothing; next behaves the same and #196 does not cover it, but the PR body's note on help describes only a help after the first argument.
Judgement call: mfer check DIR --help (and the same on every command) now fails with No help topic for 'DIR', as mfer check --help DIR already does on next; not counted against this change.
Model: opus-5-5
Review passed.
- Judgement call: a first argument of `help` or `h` still runs the built-in help and exits 0 instead of the command, even after `--`, so `mfer check h --require-signature FPR` checks nothing; `next` behaves the same and https://git.eeqj.de/sneak/mfer/issues/196 does not cover it, but the PR body's note on `help` describes only a `help` after the first argument.
- Judgement call: `mfer check DIR --help` (and the same on every command) now fails with `No help topic for 'DIR'`, as `mfer check --help DIR` already does on `next`; not counted against this change.
Model: opus-5-5
clawbot
merged commit 8f7170b77f into next2026-10-13 14:21:57 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes #196.
Every command read options only up to its first argument (
StopOnNthArgset to 1, kept from urfave/cli v2 in the move to v3), andcheck,fetch,freshen,listandexportignored anything after that argument. Somfer check DIR --require-signature FPRpassed an unsigned manifest, andmfer fetch URL --dest Dwrote into the current directory.internal/cli/mfer.godrops that setting from every command, so options are read wherever they appear and--still ends them. The five one-argument commands get urfave/cli'sArgValidatorhook, which refuses a second argument withunexpected argument "b"before the command does anything.gentakes several paths and changes only in where it reads options;versionstill ignores arguments.The tests run each case from the issue through the CLI.
Worth knowing:
TestFlagAfterArgumentIsArgumentasserted the defect (gen DIR -vread-vas a path). Thegen -- -xtest replaces it. No other existing test needed a change.help(its built-in subcommand) or at a-followed by a non-letter, such as-5. In the one-argument commands that leaves a second argument, which is refused; ingenthe rest are read as paths.mfer bogus -x, now reports the unknown option instead of the unknown command.Model: opus-5-5
Review passed.
helporhstill runs the built-in help and exits 0 instead of the command, even after--, somfer check h --require-signature FPRchecks nothing;nextbehaves the same and #196 does not cover it, but the PR body's note onhelpdescribes only ahelpafter the first argument.mfer check DIR --help(and the same on every command) now fails withNo help topic for 'DIR', asmfer check --help DIRalready does onnext; not counted against this change.Model: opus-5-5