Skip to content

feat(output): add --no-hints flag to suppress advisory hints (#214)#226

Merged
ktn-jamf merged 5 commits into
mainfrom
worktree-feat-no-hints-214
May 31, 2026
Merged

feat(output): add --no-hints flag to suppress advisory hints (#214)#226
ktn-jamf merged 5 commits into
mainfrom
worktree-feat-no-hints-214

Conversation

@ktn-jamf
Copy link
Copy Markdown
Collaborator

Problem

Closes #214.

--quiet is overloaded. A single flag drives three independent suppression paths:

  • the list-size advisory hint (hint: 73 results returned. Narrow with …)
  • the Loading… spinner
  • progress / status output in various commands

A user who only wants the hint gone has no choice but to also kill the spinner and all progress feedback. The issue requests a narrower opt-out.

Solution

Add a --no-hints flag and a JAMF_CLI_NO_HINTS env var that suppress advisory hints only, leaving the spinner and progress output intact.

Input Hint Spinner Progress
(default) shown shown shown
--no-hints / JAMF_CLI_NO_HINTS=1 off shown shown
--quiet / -q off off off

--quiet is unchanged and remains a strict superset; the two compose (the hint is suppressed if either is set). This keeps the documented CI pattern JAMF_CLI_ARGS='--quiet --no-input' working — no behavior change for existing users.

The hint is emitted inside the Formatter, so this is wired once (one field + one global flag) and applies to every command; no per-command edits.

Env-var semantics

JAMF_CLI_NO_HINTS is value-parsed via strconv.ParseBool, not presence-based like NO_COLOR. So JAMF_CLI_NO_HINTS=0 / =false correctly leaves hints on, avoiding the well-known NO_COLOR=0-still-disables footgun for a Jamf-owned variable.

Changes

  • internal/output/output.gonoHints field, SetNoHints setter, gate in maybePrintListHint
  • internal/commands/root.gonoHints global, --no-hints flag, JAMF_CLI_NO_HINTS parse, formatter wiring, Long help line
  • CLAUDE.md — convention note beside the existing NO_COLOR entry
  • docs/superpowers/specs/2026-05-30-no-hints-flag-design.md — design spec

Testing

Built test-first (RED watched to fail for both the formatter gate and the env wiring before implementing).

  • internal/output/list_hint_test.go--no-hints suppresses the hint; regression guard that it does not flip quiet
  • internal/commands/root_test.go — table test that JAMF_CLI_NO_HINTS truthy values enable and 0/false/empty/garbage leave hints on
  • make test: full suite passes (0 failures) · make lint: 0 issues · make build: ok
  • Verified --no-hints and JAMF_CLI_NO_HINTS surface in --help, and that shouldShowSpinner() does not reference noHints (spinner provably untouched)

🤖 Generated with Claude Code

ktn-jamf and others added 3 commits May 30, 2026 16:28
Narrow opt-out for the list-size advisory hint without the broader
suppression of --quiet (which also kills the spinner and progress
output). Adds --no-hints flag + JAMF_CLI_NO_HINTS env var.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
--quiet is overloaded: it suppresses the list-size advisory hint, the
loading spinner, and progress output all at once. Users who only want
the hint gone had no narrower option.

Add --no-hints (and JAMF_CLI_NO_HINTS env) that suppresses advisory
hints only, leaving the spinner and progress output intact. --quiet
remains a strict superset; the two compose (hint off if either set).

The env var is value-parsed via strconv.ParseBool (unlike NO_COLOR's
presence semantics) so JAMF_CLI_NO_HINTS=0 correctly leaves hints on.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
neilmartin83
neilmartin83 previously approved these changes May 31, 2026
Self-review follow-up. The suite proved the hint is suppressed but not
that the spinner survives — the defining invariant of #214. Add
TestShouldShowSpinner_IgnoresNoHints so a future change leaking noHints
into shouldShowSpinner() is caught. Rename the misleadingly-named
TestListHint_NoHintsKeepsSpinnerSemantics to
TestListHint_NoHintsDoesNotImplyQuiet (it asserts quiet independence,
not spinner behavior, which lives in the commands package).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ktn-jamf ktn-jamf enabled auto-merge (squash) May 31, 2026 04:10
@ktn-jamf ktn-jamf requested a review from neilmartin83 May 31, 2026 04:10
@ktn-jamf ktn-jamf merged commit c71ad8a into main May 31, 2026
1 check passed
@ktn-jamf ktn-jamf deleted the worktree-feat-no-hints-214 branch May 31, 2026 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Way to disable hints without using --quiet

2 participants