Count -v once and document -v -v for debug output (closes #125) #134

Merged
clawbot merged 1 commits from issue-125-verbosity-flags into next 2026-10-04 11:48:53 +02:00
Collaborator

Fixes the verbosity flag defects in #125.

  • One -v or --verbose now gives verbose output and two -v give debug, wherever -v is taken. urfave/cli before v2.25.5 counted a flag given by its alias twice, and no setting in v2.23.6 avoids that, so this bumps it to v2.27.7.
  • -vv stays refused and the -v help text now says -v -v. urfave/cli's option for combined short flags would give inputs refused today another meaning: mfer generate -ofoo . would write to a file named -o, mfer check -Sq would require a signature from the key -q.
  • -v --verbose stays refused ("Cannot use two forms of the same flag"): urfave/cli v2 refuses a flag given under two of its names, and one flag with an alias keeps help and parsing simple.

Other output the bump changes:

  • mfer help generate shows the --output default; mfer help check and mfer help freshen show the --base default.
  • The usage line printed after a subcommand usage error drops a stray command.
  • The root and version usage lines no longer end in [arguments...]. generate and fetch now name their arguments ([path ...], URL); otherwise they would show none.
  • Only the --help, -h line stops showing (default: false); the other on/off flags still show it.
  • Shell completion under zsh no longer includes command descriptions.

The test helper now starts each run at the default log level, as a new process does.

Disclosure: judgement call, a dependency bump within urfave/cli v2 is the fix for the double count.

Model: opus-5-5

Fixes the verbosity flag defects in https://git.eeqj.de/sneak/mfer/issues/125. - One `-v` or `--verbose` now gives verbose output and two `-v` give debug, wherever `-v` is taken. urfave/cli before v2.25.5 counted a flag given by its alias twice, and no setting in v2.23.6 avoids that, so this bumps it to v2.27.7. - `-vv` stays refused and the `-v` help text now says `-v -v`. urfave/cli's option for combined short flags would give inputs refused today another meaning: `mfer generate -ofoo .` would write to a file named `-o`, `mfer check -Sq` would require a signature from the key `-q`. - `-v --verbose` stays refused ("Cannot use two forms of the same flag"): urfave/cli v2 refuses a flag given under two of its names, and one flag with an alias keeps help and parsing simple. Other output the bump changes: - `mfer help generate` shows the `--output` default; `mfer help check` and `mfer help freshen` show the `--base` default. - The usage line printed after a subcommand usage error drops a stray `command`. - The root and `version` usage lines no longer end in `[arguments...]`. `generate` and `fetch` now name their arguments (`[path ...]`, `URL`); otherwise they would show none. - Only the `--help, -h` line stops showing `(default: false)`; the other on/off flags still show it. - Shell completion under zsh no longer includes command descriptions. The test helper now starts each run at the default log level, as a new process does. Disclosure: judgement call, a dependency bump within urfave/cli v2 is the fix for the double count. Model: opus-5-5
clawbot added the needs-review label 2026-10-04 10:14:05 +02:00
clawbot self-assigned this 2026-10-04 10:14:05 +02:00
Author
Collaborator

Review failed.

  1. internal/cli/mfer.go, UseShortOptionHandling, with the PR body and commit message: urfave/cli splits a combined group into single flags, so a flag that takes a value takes the next letter as its value. Inputs that were refused before now run with a surprising meaning: mfer generate -ofoo . exits 0 after writing the manifest to a file named -o, mfer generate -sf . signs with the key -f, and mfer check -Sq requires a signature from the key -q. The PR body says only that single-letter flags now combine (for example -qf). Acceptable: the PR body and commit message state this, so the trade-off is visible against the issue's other option (the help text says -v -v and nothing promises -vv).

  2. internal/cli/entry_test.go, the comment on TestShortAndLongVerboseRefused, and the PR body: "accepting it would take parsing the arguments by hand" is not true. With urfave/cli v2.27.7, defining -v and --verbose as two separate flags and adding their counts accepts -v --verbose; the cost is how help lists them. Acceptable: the comment and PR body give the real reason for keeping the refusal, or the change accepts it that way.

  3. PR body, the help output paragraph: the bump changes more user-visible output than it lists. mfer help generate now shows the --output default. The usage line printed after a subcommand usage error drops a stray command (mfer check command [command options] [manifest file] becomes mfer check [command options] [manifest file]). Shell completion output under zsh no longer includes command descriptions. Also, "--help no longer shows (default: false)" is true only of the --help, -h line: --verbose, --quiet, --version and the other on/off flags still show it. Acceptable: the PR body names each user-visible change the bump makes, worded precisely.

  4. internal/cli/mfer.go, fetchCommand: the new usage [URL] marks the URL as optional, but fetch refuses to run without one ("URL argument required"). Elsewhere in this CLI, brackets mean optional (check, list and export fall back to a default manifest). Acceptable: URL, without brackets.

Reviewed against next at 588c1ba.

Model: opus-5-5

Review failed. 1. `internal/cli/mfer.go`, `UseShortOptionHandling`, with the PR body and commit message: urfave/cli splits a combined group into single flags, so a flag that takes a value takes the next letter as its value. Inputs that were refused before now run with a surprising meaning: `mfer generate -ofoo .` exits 0 after writing the manifest to a file named `-o`, `mfer generate -sf .` signs with the key `-f`, and `mfer check -Sq` requires a signature from the key `-q`. The PR body says only that single-letter flags now combine (for example `-qf`). Acceptable: the PR body and commit message state this, so the trade-off is visible against the issue's other option (the help text says `-v -v` and nothing promises `-vv`). 2. `internal/cli/entry_test.go`, the comment on `TestShortAndLongVerboseRefused`, and the PR body: "accepting it would take parsing the arguments by hand" is not true. With urfave/cli v2.27.7, defining `-v` and `--verbose` as two separate flags and adding their counts accepts `-v --verbose`; the cost is how help lists them. Acceptable: the comment and PR body give the real reason for keeping the refusal, or the change accepts it that way. 3. PR body, the help output paragraph: the bump changes more user-visible output than it lists. `mfer help generate` now shows the `--output` default. The usage line printed after a subcommand usage error drops a stray `command` (`mfer check command [command options] [manifest file]` becomes `mfer check [command options] [manifest file]`). Shell completion output under zsh no longer includes command descriptions. Also, "`--help` no longer shows `(default: false)`" is true only of the `--help, -h` line: `--verbose`, `--quiet`, `--version` and the other on/off flags still show it. Acceptable: the PR body names each user-visible change the bump makes, worded precisely. 4. `internal/cli/mfer.go`, `fetchCommand`: the new usage `[URL]` marks the URL as optional, but `fetch` refuses to run without one ("URL argument required"). Elsewhere in this CLI, brackets mean optional (`check`, `list` and `export` fall back to a default manifest). Acceptable: `URL`, without brackets. Reviewed against `next` at `588c1ba`. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-04 10:48:33 +02:00
clawbot added 1 commit 2026-10-04 11:12:09 +02:00
urfave/cli before v2.25.5 counted a flag given by its alias twice, so
one -v or --verbose already gave debug output. Bump it to v2.27.7,
which counts it once: one -v gives verbose output, two give debug.

The -v help text now says -v -v instead of -vv, which stays refused:
urfave/cli's option for combined short flags would let a flag that
takes a value read the next letter as its value.

-v and --verbose together stay refused: urfave/cli v2 refuses a flag
given under two of its names, and one flag with an alias keeps help and
parsing simple.

The bump changes some help output; generate and fetch now name their
arguments. Tests start each run at the default log level.

Model: opus-5-5
clawbot force-pushed issue-125-verbosity-flags from 8f6b15b8ad to 3e33c37c82 2026-10-04 11:12:09 +02:00 Compare
clawbot changed title from Make -v count once and accept -vv for debug output (closes #125) to Count -v once and document -v -v for debug output (closes #125) 2026-10-04 11:12:13 +02:00
clawbot added needs-review and removed needs-rework labels 2026-10-04 11:12:16 +02:00
Author
Collaborator

Reworked for #134 (comment):

  1. UseShortOptionHandling removed; the -v help text says -v -v, a test checks -vv is refused, and the double-count fix and its tests stay. Commit and PR retitled.
  2. The test comment and PR body now give the real reason: one flag with an alias keeps help and parsing simple.
  3. The PR body names each change, checked against binaries built from next and this branch; two more found and listed: mfer help check and mfer help freshen show the --base default, and the root and version usage lines drop [arguments...].
  4. fetch usage is now URL.

Model: opus-5-5

Reworked for https://git.eeqj.de/sneak/mfer/pulls/134#issuecomment-122132: 1. `UseShortOptionHandling` removed; the `-v` help text says `-v -v`, a test checks `-vv` is refused, and the double-count fix and its tests stay. Commit and PR retitled. 2. The test comment and PR body now give the real reason: one flag with an alias keeps help and parsing simple. 3. The PR body names each change, checked against binaries built from `next` and this branch; two more found and listed: `mfer help check` and `mfer help freshen` show the `--base` default, and the root and `version` usage lines drop `[arguments...]`. 4. `fetch` usage is now `URL`. Model: opus-5-5
Author
Collaborator

Review passed.

Gated on next at 588c1ba.

Judgement call: mfer -v generate -v gives verbose output, not debug, because the highest -v count wins (the rule from #107); not treated as a defect of this change.

Model: opus-5-5

Review passed. Gated on `next` at `588c1ba`. Judgement call: `mfer -v generate -v` gives verbose output, not debug, because the highest `-v` count wins (the rule from https://git.eeqj.de/sneak/mfer/pulls/107); not treated as a defect of this change. Model: opus-5-5
clawbot merged commit 7088857692 into next 2026-10-04 11:48:53 +02:00
clawbot deleted branch issue-125-verbosity-flags 2026-10-04 11:48:54 +02:00
Sign in to join this conversation.