# `Alaja.CLI.Parser`
[🔗](https://github.com/Lorenzo-SF/alaja/blob/2.1.0/lib/alaja/cli/parser.ex#L1)

Shared parsing utilities for CLI commands.

Handles repeated flags, quoted values, environment variables,
color parsing, and other common patterns.

# `collect_repeated`

```elixir
@spec collect_repeated([String.t()], String.t()) :: [String.t()]
```

Collects all values for a repeated `--flag` from raw args.

Supports both `--flag value` and `--flag=value` forms.

# `parse_align`

```elixir
@spec parse_align(String.t() | atom() | nil) :: :left | :center | :right
```

Parses an alignment string into an atom.

# `parse_color`

```elixir
@spec parse_color(String.t() | nil) ::
  {:ok, {byte(), byte(), byte()}} | {:error, term()} | nil
```

Parses a color string using the Drawer colour system.
Returns `{:ok, {r,g,b}}` or `{:error, reason}`.

# `parse_color_list`

```elixir
@spec parse_color_list(String.t() | nil) ::
  {:ok, [tuple()]} | {:error, String.t()} | nil
```

Parses a semicolon-separated list of colors.
Returns `{:ok, [{r,g,b}, ...]}` or `{:error, message}`.

# `parse_color_opt`

```elixir
@spec parse_color_opt(String.t() | nil) :: {byte(), byte(), byte()} | nil
```

Parses a color and returns the RGB tuple, or prints error to stderr and returns nil.

# `parse_env_pair`

```elixir
@spec parse_env_pair(String.t()) :: {atom(), String.t()} | nil
```

Parses a `KEY=VALUE` string into a tuple.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
