Use ValueEnum for --level and --format CLI args #14

Open
opened 2026-07-25 11:17:50 +00:00 by GKaszewski · 0 comments
Owner

Severity: Medium

crates/presentation/src/lib.rs lines 289-295: any unrecognized --level value silently defaults to Module via the _ arm. A user typing --level typ (a typo) gets no feedback.

--level and --format are String in the CLI struct (crates/presentation/src/cli.rs lines 17-21) when they should be enums with clap::ValueEnum derive. Clap would then validate and provide shell completions for free.

**Severity: Medium** `crates/presentation/src/lib.rs` lines 289-295: any unrecognized `--level` value silently defaults to `Module` via the `_` arm. A user typing `--level typ` (a typo) gets no feedback. `--level` and `--format` are `String` in the CLI struct (`crates/presentation/src/cli.rs` lines 17-21) when they should be enums with `clap::ValueEnum` derive. Clap would then validate and provide shell completions for free.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GKaszewski/archlens#14