Repository navigation
feat(cli)!: warn when --column is used without table output - #30147
nickvigilante merged 3 commits into
Conversation
4c3ac41 to
aebee17
Compare
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
| // WarnIgnoredColumnFlag warns to stderr when --column/-c is explicitly | ||
| // passed but the resolved --output format is not "table", since --column | ||
| // only affects table rendering. The command still runs normally. | ||
| func WarnIgnoredColumnFlag() serpent.MiddlewareFunc { |
There was a problem hiding this comment.
this middleware is very specific, while the preceding ones are more generic. this routine could be used for warning on multiple conflicting options, so maybe a better (or worse) name could be WarnConflictingOptions to match PrintDeprecatedOptions?
There was a problem hiding this comment.
Good point, WarnIgnoredColumnFlag is too narrow for where it sits next to PrintDeprecatedOptions.
I'll rename it to WarnConflictingOptions (and TestWarnIgnoredColumnFlag to match).
For scope, my plan is to keep --column without table output as the only check in this PR, but structure the body so more conflicting-option checks can be added alongside it later without another rename.
Does that work for you, or would you rather see it generalized now (for example, a small list of conflict rules the middleware iterates over)?
This reply was generated by Coder Agents on behalf of @nickvigilante.
There was a problem hiding this comment.
that works great, I want to make it extensible so setting up the body that way will suffice
e95ef20 to
b807e95
Compare
`-c/--column` only affects table output, but it was silently ignored with `-o json` or on commands whose default format is text, such as `coder organizations show`. Linear: CLI-30
Run a list of conflicting-option checks so more can be added without another rename, as discussed in review. --column without table output stays the only check.
Matches the styled WARN: prefix used by other CLI warnings. Co-authored-by: Samuel Volin <[email protected]>
b807e95 to
ef490e5
Compare
|
@untra Another nudge for a review |
-c/--columnonly affects table output, but it was silently ignored with-o jsonor on commands whose default format is text, such ascoder organizations show.A root middleware next to
PrintDeprecatedOptionsnow printsWARN: --column only applies to table output; add -o table to use itto stderr (viacliui.Warn) when-cis passed explicitly and the resolved output format isn'ttable.Behavior change: New stderr warning in that case only.
Stdout, exit codes, and behavior are unchanged.
No warning when
-cisn't passed, when output istable, or on commands without-o.Decisions
users suspend/activatehas-cbut no-o(no warning);features listdeclares its flags directly (still matched);templates versions listonly changes the default columns (no false positive).Closes CLI-30
This PR was generated by Coder Agents on behalf of @nickvigilante.