From 7ebdeba8ce47c7e452bd12cddbaecee84de16030 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Sun, 13 Feb 2022 20:08:11 -0600 Subject: [PATCH] add --fetch-grammars and --build-grammars CLI flags --- helix-term/src/args.rs | 4 ++++ helix-term/src/main.rs | 16 +++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/helix-term/src/args.rs b/helix-term/src/args.rs index 4f386aea8a20..6a8a1e7c0237 100644 --- a/helix-term/src/args.rs +++ b/helix-term/src/args.rs @@ -9,6 +9,8 @@ pub struct Args { pub health: bool, pub health_arg: Option, pub load_tutor: bool, + pub fetch_grammars: bool, + pub build_grammars: bool, pub verbosity: u64, pub files: Vec<(PathBuf, Position)>, } @@ -30,6 +32,8 @@ impl Args { args.health = true; args.health_arg = argv.next_if(|opt| !opt.starts_with('-')); } + "--fetch-grammars" => args.fetch_grammars = true, + "--build-grammars" => args.build_grammars = true, arg if arg.starts_with("--") => { anyhow::bail!("unexpected double dash argument: {}", arg) } diff --git a/helix-term/src/main.rs b/helix-term/src/main.rs index cde26c2e72ac..0760e204229a 100644 --- a/helix-term/src/main.rs +++ b/helix-term/src/main.rs @@ -59,13 +59,15 @@ ARGS: ... Sets the input file to use, position can also be specified via file[:row[:col]] FLAGS: - -h, --help Prints help information - --tutor Loads the tutorial - --health [LANG] Checks for potential errors in editor setup - If given, checks for config errors in language LANG - -v Increases logging verbosity each use for up to 3 times - (default file: {}) - -V, --version Prints version information + -h, --help Prints help information + --tutor Loads the tutorial + --health [LANG] Checks for potential errors in editor setup + If given, checks for config errors in language LANG + --fetch-grammars Fetches tree-sitter grammars listed in languages.toml + --build-grammars Builds tree-sitter grammars fetched with --fetch-grammars + -v Increases logging verbosity each use for up to 3 times + (default file: {}) + -V, --version Prints version information ", env!("CARGO_PKG_NAME"), env!("VERSION_AND_GIT_HASH"),