@salesforce/b2c-tooling-sdk / cli / selectColumns
Function: selectColumns()
selectColumns<
T>(flags,renderer,defaults,warn):string[]
Defined in: packages/b2c-tooling-sdk/src/cli/columns.ts:149
Resolves which columns a list-style command should render. Mirrors the pattern duplicated across all *List commands:
- If
flags.columns === 'id,name'is provided, validate against the renderer's known keys; warn (and fall back to defaults) when no valid keys remain. - If
flags.extendedis set, return every column key (including those markedextended: true). - Otherwise, return the supplied default set.
Type Parameters
T
T
Row type (carried through the renderer).
Parameters
flags
The command's parsed --columns / --extended values. The parameter accepts the wider ColumnFlags shape, so callers can pass this.flags directly even when the inferred type contains additional fields.
renderer
The TableRenderer backing the table — used for key validation and to enumerate keys in extended mode.
defaults
string[]
Fallback set returned when neither flag overrides the selection.
warn
WarnFn = console.warn
Optional warn callback invoked when --columns is provided but no key validates; defaults to console.warn.
Returns
string[]
Ordered list of column keys to render.