diff --git a/Cargo.toml b/Cargo.toml index 89a3dbea..6e1d838f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,9 +9,6 @@ members = [ "fluent-testing", "fluent", "intl-memoizer", -] - -exclude = [ "fluent-cli", ] diff --git a/fluent-cli/Cargo.toml b/fluent-cli/Cargo.toml index 123d3198..9062e37a 100644 --- a/fluent-cli/Cargo.toml +++ b/fluent-cli/Cargo.toml @@ -6,7 +6,7 @@ for Fluent Localization System. """ version = "0.0.1" edition.workspace = true -rust-version.workspace = true +rust-version = "1.74.0" homepage.workspace = true repository.workspace = true license.workspace = true @@ -29,4 +29,4 @@ fluent-syntax.workspace = true serde = { workspace = true, features = ["derive"]} serde_json.workspace = true annotate-snippets = { version = "0.6", features = ["color"] } -clap = "2.33" +clap = "4.5" diff --git a/fluent-cli/src/main.rs b/fluent-cli/src/main.rs index d0ef62ef..bbe4bed1 100644 --- a/fluent-cli/src/main.rs +++ b/fluent-cli/src/main.rs @@ -1,17 +1,22 @@ -use clap::App; +use clap::{Arg, ArgAction, Command}; use fluent_cli::parse_file; fn main() { - let matches = App::new("Fluent Parser") - .version("1.0") + let matches = Command::new("Fluent Parser") + .version("0.0.1") .about("Parses FTL file into an AST") - .args_from_usage( - "-s, --silent 'Disables error reporting' - 'FTL file to parse'", + .arg( + Arg::new("silent") + .short('s') + .long("silent") + .action(ArgAction::SetTrue) + .help("Disables error reporting"), ) + .arg(Arg::new("FILE").required(true).help("FTL file to parse")) .get_matches(); - let input = matches.value_of("FILE").unwrap(); - parse_file(input, matches.is_present("silent")); + let input: &String = matches.get_one("FILE").unwrap(); + let silent: bool = *matches.get_one("silent").unwrap(); + parse_file(input, silent); }