Skip to content

Commit

Permalink
Fix alternative output formats (#1188)
Browse files Browse the repository at this point in the history
  • Loading branch information
slotThe authored Nov 10, 2024
1 parent 3f07a0c commit 91f2043
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down

0 comments on commit 91f2043

Please sign in to comment.