Fix alternative output formats (#1188)

This commit is contained in:
Tony Zorman 2024-11-10 10:16:49 +01:00 committed by GitHub
parent 3f07a0c7c6
commit 91f2043478
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 7 deletions

View File

@ -158,13 +158,7 @@ impl Cli {
Arg::new("output")
.long("output")
.short('o')
.value_parser(|x: &str| {
if Format::all().contains(&x) {
Ok(x.to_string())
} else {
Err(format!("Invalid output format: {x:?}"))
}
})
.value_parser(Format::from_str)
.help(
"Outputs Tokei in a specific format. Compile with additional features for \
more format support.",