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 6, 2022
1 parent 0157df7 commit 4d8732e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions helix-term/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ pub struct Args {
pub display_help: bool,
pub display_version: bool,
pub load_tutor: bool,
pub fetch_grammars: bool,
pub build_grammars: bool,
pub verbosity: u64,
pub files: Vec<(PathBuf, Position)>,
}
Expand All @@ -25,6 +27,8 @@ impl Args {
"--version" => args.display_version = true,
"--help" => args.display_help = true,
"--tutor" => args.load_tutor = true,
"--fetch-grammars" => args.fetch_grammars = true,
"--build-grammars" => args.build_grammars = true,
arg if arg.starts_with("--") => {
return Err(Error::msg(format!(
"unexpected double dash argument: {}",
Expand Down
12 changes: 7 additions & 5 deletions helix-term/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ 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
-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
--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 4d8732e

Please sign in to comment.