From 91f204347827c871f66ced6f6339009c2fed4fde Mon Sep 17 00:00:00 2001 From: Tony Zorman Date: Sun, 10 Nov 2024 10:16:49 +0100 Subject: [PATCH] Fix alternative output formats (#1188) --- src/cli.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 514684d63..6849d1ed0 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -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.",