Skip to main content

Module style_spec

Module style_spec 

Source
Expand description

Parser for the --status-style / --prompt-style CLI flags and the per-format prompt_style config key. Maps a comma-separated token list onto an ansi::Style.

Grammar:

spec   := token ("," token)*
token  := attr | "fg=" color | "bg=" color
attr   := bold | dim | italic | underline | reverse
color  := name | "#RRGGBB" | "0".."255"
name   := ("bright-")? (black|red|green|yellow|blue|magenta|cyan|white)

Empty input is treated as “no styling” and returns Ok(Style::default()).

Enums§

ParseError

Functions§

parse
Parse a style spec into an ansi::Style. Empty / whitespace-only input returns Style::default() so callers can treat empty CLI flags as “off”.