Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revive CLI tooling #360

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ members = [
"fluent-testing",
"fluent",
"intl-memoizer",
]

exclude = [
"fluent-cli",
]

Expand Down
4 changes: 2 additions & 2 deletions fluent-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
21 changes: 13 additions & 8 deletions fluent-cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -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'
<FILE> '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);
}