Skip to content

docs: surface that --fields is accepted as an alias for --select on most commands #814

Description

@privatenumber

Summary

The global --fields is accepted as an alias for --select (JSON output projection) on every
command that doesn't define its own API field-mask --fields. This is intentional and helpful
(agents often guess --fields for output projection), but it is only surfaced on the --select
flag help, so someone reaching for --fields directly won't discover it. A one-line note in the
agent / global-flags docs would close the discoverability gap.

Details (v0.22.0, 197992a)

  • The rewrite happens in internal/cmd/root.go:251-274 (see the explanatory comment at :251-255);
    commands with a real field-mask --fields are exempted via commandHasLocalFieldsFlagBefore
    (root.go:308).
  • Currently documented only on the --select help text (root.go:44: "Desire path: use --fields
    for most commands").

Suggested change (docs only, behavior is correct)

Add a line to the agent-patterns / global-flags documentation, e.g.: "--fields is accepted as an
alias for --select (output field projection) on commands that don't take an API field mask."

Environment

gog v0.22.0 (confirmed by reading source at 197992a). Working as designed; this is a
discoverability/docs request, not a bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.no-staleExempts this issue from stale automation.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions