From b90edc91346bb40ebdb8fc337b1b6a8bcefafcb9 Mon Sep 17 00:00:00 2001 From: Pete Dietl Date: Tue, 23 Jan 2024 03:21:40 -0800 Subject: [PATCH] Change --help output to list all possible choices for --chip Also, make the parsing of the argument to --chip be case-insensitive --- src/lib.rs | 3 ++- src/main.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 9b521fb..757f3b5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,12 +11,13 @@ pub mod probe; pub mod regs; pub mod usb_device; +use clap::ValueEnum; use probe::WchLink; pub use crate::error::{Error, Result}; /// Currently supported RISC-V chip series/family -#[derive(Clone, Copy, Debug, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, ValueEnum)] #[repr(u8)] pub enum RiscvChip { /// CH32V103 RISC-V3A series diff --git a/src/main.rs b/src/main.rs index 9dcaa4f..394f148 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,7 +28,7 @@ struct Cli { no_detach: bool, /// Specify the chip type, e.g. CH32V30X - #[arg(long, global = true)] + #[arg(long, global = true, ignore_case = true)] chip: Option, /// Connection Speed