Skip to content

feat(cli)!: warn when --column is used without table output - #30147

Merged
nickvigilante merged 3 commits into
mainfrom
vigilante/cli-30-cli-warn-on-stderr-when-c-column-is-used-without-table
Nov 10, 2026
Merged

nickvigilante merged 3 commits into
mainfrom
vigilante/cli-30-cli-warn-on-stderr-when-c-column-is-used-without-table

Conversation

@nickvigilante

@nickvigilante nickvigilante commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

-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.

A root middleware next to PrintDeprecatedOptions now prints WARN: --column only applies to table output; add -o table to use it to stderr (via cliui.Warn) when -c is passed explicitly and the resolved output format isn't table.

Behavior change: New stderr warning in that case only.
Stdout, exit codes, and behavior are unchanged.
No warning when -c isn't passed, when output is table, or on commands without -o.

Decisions
  • Checked special cases: users suspend/activate has -c but no -o (no warning); features list declares its flags directly (still matched); templates versions list only changes the default columns (no false positive).

Closes CLI-30

This PR was generated by Coder Agents on behalf of @nickvigilante.

@linear-code

linear-code Bot commented Sep 30, 2026

Copy link
Copy Markdown

CLI-30

@nickvigilante
nickvigilante force-pushed the vigilante/cli-30-cli-warn-on-stderr-when-c-column-is-used-without-table branch from 4c3ac41 to aebee17 Compare September 30, 2026 00:52
@nickvigilante
nickvigilante marked this pull request as ready for review September 30, 2026 02:53
@matifali

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-30T05:49:16.439218Z aebee17 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: aebee17877

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@nickvigilante nickvigilante changed the title feat(cli): warn when --column is used without table output feat(cli)!: warn when --column is used without table output Sep 30, 2026
@github-actions github-actions Bot added the release/breaking This label is applied to PRs to detect breaking changes as part of the release process label Sep 30, 2026
@nickvigilante nickvigilante added the cli Area: CLI label Oct 5, 2026
Comment thread cli/root.go Outdated
Comment on lines +1958 to +1961
// 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 {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that works great, I want to make it extensible so setting up the body that way will suffice

@matifali
matifali removed their request for review October 9, 2026 07:20
@nickvigilante
nickvigilante force-pushed the vigilante/cli-30-cli-warn-on-stderr-when-c-column-is-used-without-table branch from e95ef20 to b807e95 Compare October 16, 2026 18:36
@nickvigilante
nickvigilante requested a review from untra October 16, 2026 19:36
Comment thread cli/root.go Resolved
nickvigilante and others added 3 commits October 21, 2026 17:33
`-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]>
@nickvigilante
nickvigilante force-pushed the vigilante/cli-30-cli-warn-on-stderr-when-c-column-is-used-without-table branch from b807e95 to ef490e5 Compare October 21, 2026 17:40
@nickvigilante
nickvigilante requested a review from untra October 21, 2026 17:40
@github-actions github-actions Bot added the stale This issue is like stale bread. label Nov 6, 2026
@github-actions github-actions Bot closed this Nov 9, 2026
@nickvigilante nickvigilante removed the stale This issue is like stale bread. label Nov 10, 2026
@nickvigilante nickvigilante reopened this Nov 10, 2026
@nickvigilante
nickvigilante temporarily deployed to main November 10, 2026 17:34 — with GitHub Actions Inactive
@nickvigilante

Copy link
Copy Markdown
Collaborator Author

@untra Another nudge for a review

@nickvigilante
nickvigilante merged commit dca5c97 into main Nov 10, 2026
60 checks passed
@nickvigilante
nickvigilante deleted the vigilante/cli-30-cli-warn-on-stderr-when-c-column-is-used-without-table branch November 10, 2026 19:59
@nickvigilante
nickvigilante temporarily deployed to main November 10, 2026 19:59 — with GitHub Actions Inactive
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 10, 2026

This branch was previously deployed

1 inactive deployment
main — ef490e52 Deployed Nov 10, 2026 by nickvigilante via cla #253685
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cli Area: CLI release/breaking This label is applied to PRs to detect breaking changes as part of the release process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants