Skip to content

Commit

Permalink
add --fetch-grammars and --build-grammars CLI flags
Browse files Browse the repository at this point in the history
  • Loading branch information
the-mikedavis committed Mar 8, 2022
1 parent b7f7e68 commit 7ebdeba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
4 changes: 4 additions & 0 deletions helix-term/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ pub struct Args {
pub health: bool,
pub health_arg: Option<String>,
pub load_tutor: bool,
pub fetch_grammars: bool,
pub build_grammars: bool,
pub verbosity: u64,
pub files: Vec<(PathBuf, Position)>,
}
Expand All @@ -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)
}
Expand Down
16 changes: 9 additions & 7 deletions helix-term/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,15 @@ ARGS:
<files>... 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"),
Expand Down

0 comments on commit 7ebdeba

Please sign in to comment.