pub fn parse_columns(spec: &str, compare_side: bool) -> Result<Vec<Column>>Expand description
Parse a CLI --columns spec into a typed Column vec.
Format: comma-separated names matching Column::cli_name.
Whitespace around each name is trimmed. Empty input parses
to an empty Vec — caller falls back to the format default.
compare_side controls which subset is allowed:
trueaccepts every variant exceptColumn::Value(show-only).falseaccepts every variant exceptColumn::Baseline,Column::Candidate,Column::Delta,Column::Pct,Column::Arrow(compare-only).
Errors:
- Unknown name (cite the offending token; list valid names).
- Wrong-side name (e.g.
valueon compare orbaselineon show). - Duplicate name across two entries.
- Empty token between commas.
arrowpaired withbaselineorcandidate(the arrow cell already showsbaseline -> candidate; pairing those would render the same data twice).arrow + delta + %is allowed and matches the format-default forDisplayFormat::Arrow.