Summary
--select and --compact do nothing on the default output of the commands that render their own text. The flags are parsed and accepted. No error and no note says the flag had no effect.
CLAUDE.md states the rule this breaks, under Conventions: "a documented flag that does nothing is worse than an absent one, because the operator used it as documented", and "Every command that inherits -n either honours it or says in its Long what it does not cover."
Command run
jamf-cli pro overview --select summary
No -o flag, so a terminal resolves to table, which is these commands' default.
Expected behavior
Either the flag narrows the output, or --help says the flag does not apply to the default view.
Actual behavior
The full multi-section report prints. Nothing reports that --select had no effect. The same command with -o json --select ... does apply the projection, so behaviour changes with a flag the operator did not set.
Affected commands
pro overview, pro device, protect overview, school overview and doctor. Each hands a writer to a hand-rolled section renderer that never reaches Formatter.Print, so applyProjection never runs.
Why #349 did not fix it
#349 routed these commands' writer through writerFor, so --out-file now works for them. It did not change the renderer, so projection still does not apply. The state is unchanged from before #349 for these two flags.
The choice this needs
Projection on the overview row shape is not obviously useful. overviewToRows (internal/commands/pro_overview.go) emits section, resource, value and status, so --select can only name one of those four. An operator typing --select summary or --select computers names a field that does not exist in that vocabulary, and gets an empty table. So "route the table through printRows when --select is set" answers the letter and not the intent.
Two candidates:
- Say it in
Long. One sentence per command, matching how the backup commands document the shorthand they lose. Cheap, and it satisfies the convention.
- Refuse the combination. Exit 2 with a message naming
-o json as the route that supports projection.
Option 1 is the smaller change and matches the existing precedent in this repo.
Summary
--selectand--compactdo nothing on the default output of the commands that render their own text. The flags are parsed and accepted. No error and no note says the flag had no effect.CLAUDE.md states the rule this breaks, under Conventions: "a documented flag that does nothing is worse than an absent one, because the operator used it as documented", and "Every command that inherits
-neither honours it or says in itsLongwhat it does not cover."Command run
No
-oflag, so a terminal resolves totable, which is these commands' default.Expected behavior
Either the flag narrows the output, or
--helpsays the flag does not apply to the default view.Actual behavior
The full multi-section report prints. Nothing reports that
--selecthad no effect. The same command with-o json --select ...does apply the projection, so behaviour changes with a flag the operator did not set.Affected commands
pro overview,pro device,protect overview,school overviewanddoctor. Each hands a writer to a hand-rolled section renderer that never reachesFormatter.Print, soapplyProjectionnever runs.Why #349 did not fix it
#349 routed these commands' writer through
writerFor, so--out-filenow works for them. It did not change the renderer, so projection still does not apply. The state is unchanged from before #349 for these two flags.The choice this needs
Projection on the overview row shape is not obviously useful.
overviewToRows(internal/commands/pro_overview.go) emitssection,resource,valueandstatus, so--selectcan only name one of those four. An operator typing--select summaryor--select computersnames a field that does not exist in that vocabulary, and gets an empty table. So "route the table throughprintRowswhen--selectis set" answers the letter and not the intent.Two candidates:
Long. One sentence per command, matching how thebackupcommands document the shorthand they lose. Cheap, and it satisfies the convention.-o jsonas the route that supports projection.Option 1 is the smaller change and matches the existing precedent in this repo.