parse_columns

Function parse_columns 

Source
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:

Errors:

  • Unknown name (cite the offending token; list valid names).
  • Wrong-side name (e.g. value on compare or baseline on show).
  • Duplicate name across two entries.
  • Empty token between commas.
  • arrow paired with baseline or candidate (the arrow cell already shows baseline -> candidate; pairing those would render the same data twice). arrow + delta + % is allowed and matches the format-default for DisplayFormat::Arrow.