Open akrieger opened 1 year ago
I think this unnecessary parenthesis
is right, the parenthesis is not necessary.
The "expected ,
" error should comes from clap
.
For string value, if you want to use default, maybe you need write like this:
use clap::{Parser, ValueEnum};
#[derive(Parser, Debug)]
struct Args {
#[clap(value_enum, default_value_t=Level::Debug)]
level: Level,
}
#[derive(ValueEnum, Clone, Debug)]
enum Level {
Debug,
Info,
Warning,
Error,
}
fn main() {
println!("{:?}", Args::parse());
}
Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=5b455db4401f5a5f2bd6bec013fab8de
The current output is:
However removing the parenthesis results in