cmd: resolve no-op --quiet/--verbose flags (#34) #39

Merged
KofTwentyTwo merged 1 commits from feature/GH-34-quiet-verbose-flags into develop 2026-06-09 15:17:56 +00:00
KofTwentyTwo commented 2026-06-09 13:00:27 +00:00 (Migrated from github.com)

Summary

Resolves issue #34: the persistent --quiet/-q and --verbose/-v flags were bound on the root flag set but read nowhere -- pure no-op flags implying behavior they never delivered.

Decision: REMOVE (Option B), not WIRE

I reviewed how output is produced across audit/check/apply/license:

  • The only stdout output is the machine report (report.Render for audit/check/apply) plus essential confirmations (license actions, wrote <path>, version). None of that is "non-essential human output" that --quiet could legitimately suppress -- and the report/stdout contract must stay intact and pipeable.
  • There is no diagnostic or tracing facility for --verbose to enable. Notably model.ResolveOptions.Verbose is itself dead: no resolver reads it and nothing emits diagnostics anywhere.

Wiring the flags would have meant inventing new output purely to justify them -- the hollow/cosmetic wiring the issue explicitly rejects. So removing the no-ops is the honest, lower-risk choice for pre-1.0 (v0.3.0).

Passing --quiet/-q/--verbose/-v now produces an unknown-flag usage error (exit 2).

LOW item (isWriteRefusal): deferred

The optional typed-sentinel refactor of isWriteRefusal is deferred. The refusal strings span two packages (internal/applier and internal/config), so a sentinel refactor would touch the applier write/refusal path that issue #33 is changing on a separate branch -- a merge-conflict and cross-package-sprawl risk the task warns against. This change stays scoped to the CLI flag surface.

TDD

Strict red-green:

  • Updated TestNewRootCmd to assert quiet/verbose are not registered.
  • Added TestQuietVerboseFlagsRemoved asserting --quiet/-q/--verbose/-v each yield exit 2 with an "unknown" error.
  • Confirmed RED before removing the registration, then GREEN.

Docs

Updated README shared-flags list, the design doc, and added an Unreleased "Removed" CHANGELOG entry.

Gate

  • gofmt -l .: clean
  • go vet ./...: clean
  • go test ./... -race ...: all pass
  • coverage gate: 100% (2085/2085)
  • golangci-lint run: 0 issues

Closes #34

## Summary Resolves issue #34: the persistent `--quiet`/`-q` and `--verbose`/`-v` flags were bound on the root flag set but read **nowhere** -- pure no-op flags implying behavior they never delivered. ## Decision: REMOVE (Option B), not WIRE I reviewed how output is produced across `audit`/`check`/`apply`/`license`: - The only stdout output is the **machine report** (`report.Render` for audit/check/apply) plus essential confirmations (`license` actions, `wrote <path>`, `version`). None of that is "non-essential human output" that `--quiet` could legitimately suppress -- and the report/stdout contract must stay intact and pipeable. - There is **no diagnostic or tracing facility** for `--verbose` to enable. Notably `model.ResolveOptions.Verbose` is itself dead: no resolver reads it and nothing emits diagnostics anywhere. Wiring the flags would have meant **inventing new output purely to justify them** -- the hollow/cosmetic wiring the issue explicitly rejects. So removing the no-ops is the honest, lower-risk choice for pre-1.0 (v0.3.0). Passing `--quiet`/`-q`/`--verbose`/`-v` now produces an unknown-flag **usage error (exit 2)**. ## LOW item (isWriteRefusal): deferred The optional typed-sentinel refactor of `isWriteRefusal` is **deferred**. The refusal strings span **two** packages (`internal/applier` and `internal/config`), so a sentinel refactor would touch the applier write/refusal path that issue #33 is changing on a separate branch -- a merge-conflict and cross-package-sprawl risk the task warns against. This change stays scoped to the CLI flag surface. ## TDD Strict red-green: - Updated `TestNewRootCmd` to assert `quiet`/`verbose` are **not** registered. - Added `TestQuietVerboseFlagsRemoved` asserting `--quiet`/`-q`/`--verbose`/`-v` each yield exit 2 with an "unknown" error. - Confirmed RED before removing the registration, then GREEN. ## Docs Updated README shared-flags list, the design doc, and added an Unreleased "Removed" CHANGELOG entry. ## Gate - `gofmt -l .`: clean - `go vet ./...`: clean - `go test ./... -race ...`: all pass - coverage gate: **100% (2085/2085)** - `golangci-lint run`: **0 issues** Closes #34
Sign in to join this conversation.