Shared parsing utilities for CLI commands.
Handles repeated flags, quoted values, environment variables, color parsing, and other common patterns.
Summary
Functions
Collects all values for a repeated --flag from raw args.
Parses an alignment string into an atom.
Parses a color string using the Drawer colour system.
Returns {:ok, {r,g,b}} or {:error, reason}.
Parses a semicolon-separated list of colors.
Returns {:ok, [{r,g,b}, ...]} or {:error, message}.
Parses a color and returns the RGB tuple, or prints error to stderr and returns nil.
Parses a KEY=VALUE string into a tuple.
Functions
Collects all values for a repeated --flag from raw args.
Supports both --flag value and --flag=value forms.
Parses an alignment string into an atom.
Parses a color string using the Drawer colour system.
Returns {:ok, {r,g,b}} or {:error, reason}.
Parses a semicolon-separated list of colors.
Returns {:ok, [{r,g,b}, ...]} or {:error, message}.
Parses a color and returns the RGB tuple, or prints error to stderr and returns nil.
Parses a KEY=VALUE string into a tuple.