Give -v to verbose, move --version to -V (closes #64) #107

Open
clawbot wants to merge 1 commits from issue-64-v-flag-collision into next
Collaborator

Fixes #64.

urfave/cli's built-in version flag claimed -v by default, colliding with the
-v verbose alias used on every subcommand. mfer -v --version failed with
Cannot use two forms of the same flag: v version, and mfer --verbose was
undefined at the root.

Resolution: verbose owns -v (the more common meaning when a tool has both,
and already the convention on every subcommand); the version flag moves to the
capital -V. --version is unchanged. The root command gains the shared
verbose/quiet flags so -v/--verbose work there too. The choice is documented
in a comment in run().

--version and the version subcommand now route through one printer, so their
output is identical (mfer version 0.1.0 (...)).

Tests cover -v, --verbose, --version, -V, -v --version, and
--verbose --version (exit code and output), plus flag/subcommand output
equality.

Verified: docker build --no-cache . green end to end — make lint (0 issues),
make fmt-check-go, script/prettier --check, make test, and the build.

Disclosures:

  • User-visible: -v now means verbose, not version; use -V or --version.
  • User-visible: the version subcommand now prints mfer version <v> to match --version (previously bare version).
  • Local make lint/make fmt cannot run: the host golangci-lint is built with go1.25 and panics on this go1.26 host; the Docker lint stage is authoritative and passed.

Model: opus-4-8

Fixes https://git.eeqj.de/sneak/mfer/issues/64. urfave/cli's built-in version flag claimed `-v` by default, colliding with the `-v` verbose alias used on every subcommand. `mfer -v --version` failed with `Cannot use two forms of the same flag: v version`, and `mfer --verbose` was undefined at the root. Resolution: verbose owns `-v` (the more common meaning when a tool has both, and already the convention on every subcommand); the version flag moves to the capital `-V`. `--version` is unchanged. The root command gains the shared verbose/quiet flags so `-v`/`--verbose` work there too. The choice is documented in a comment in `run()`. `--version` and the `version` subcommand now route through one printer, so their output is identical (`mfer version 0.1.0 (...)`). Tests cover `-v`, `--verbose`, `--version`, `-V`, `-v --version`, and `--verbose --version` (exit code and output), plus flag/subcommand output equality. Verified: `docker build --no-cache .` green end to end — `make lint` (0 issues), `make fmt-check-go`, `script/prettier --check`, `make test`, and the build. Disclosures: - User-visible: `-v` now means verbose, not version; use `-V` or `--version`. - User-visible: the `version` subcommand now prints `mfer version <v>` to match `--version` (previously bare version). - Local `make lint`/`make fmt` cannot run: the host golangci-lint is built with go1.25 and panics on this go1.26 host; the Docker lint stage is authoritative and passed. Model: opus-4-8
clawbot added the needs-review label 2026-09-21 09:48:44 +02:00
clawbot self-assigned this 2026-09-21 09:48:44 +02:00
clawbot added 1 commit 2026-09-21 09:48:44 +02:00
urfave/cli's built-in version flag claimed -v by default, colliding with
the -v verbose alias used on every subcommand; "mfer -v --version" failed
to parse with an internal-sounding parser error. Verbose is the more
common meaning of -v in tools that offer both, so verbose now keeps -v at
the root and on every subcommand, and the version flag takes the capital
-V (--version still works).

User-visible change: -v alone now prints help with verbose logging rather
than the version; use -V or --version for the version.

The --version flag and the version subcommand now share one printer, so
they emit identical output. Adds tests covering -v, --verbose, --version,
-v --version, and --verbose --version (exit code and output).

Model: opus-4-8
Author
Collaborator

Review passed.

Gated against the current next head after rebasing; the TODO.md conflict was resolved by keeping every Completed Steps entry.

The README 1.0 roadmap still lists "Wire --version flag properly" and describes top-level --version as generic urfave output, which this PR makes stale — not counted as a finding, since this repo does not update that checklist per-PR (the completed .editorconfig and .golangci.yml items remain unchecked there too).

Model: opus-4-8

Review passed. Gated against the current `next` head after rebasing; the `TODO.md` conflict was resolved by keeping every Completed Steps entry. The README 1.0 roadmap still lists "Wire `--version` flag properly" and describes top-level `--version` as generic urfave output, which this PR makes stale — not counted as a finding, since this repo does not update that checklist per-PR (the completed `.editorconfig` and `.golangci.yml` items remain unchecked there too). Model: opus-4-8
clawbot added needs-rebase and removed needs-review labels 2026-09-22 00:48:13 +02:00
Some required checks failed
check / check (push) Failing after 1s
This pull request has changes conflicting with the target branch.
  • TODO.md
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-64-v-flag-collision:issue-64-v-flag-collision
git checkout issue-64-v-flag-collision
Sign in to join this conversation.