on master help sign in
add --fetch-grammars and --build-grammars CLI flags
8330f6aMichael Davis
helix-term/src/args.rs+4
@@ -9,6 +9,8 @@ pub struct Args {
9 pub health: bool,
9 pub health: bool,
10 pub health_arg: Option<String>,
10 pub health_arg: Option<String>,
11 pub load_tutor: bool,
11 pub load_tutor: bool,
12+ pub fetch_grammars: bool,
13+ pub build_grammars: bool,
12 pub verbosity: u64,
14 pub verbosity: u64,
13 pub files: Vec<(PathBuf, Position)>,
15 pub files: Vec<(PathBuf, Position)>,
14 pub edit_config: bool,
16 pub edit_config: bool,
@@ -32,6 +34,8 @@ impl Args {
32 args.health = true;
34 args.health = true;
33 args.health_arg = argv.next_if(|opt| !opt.starts_with('-'));
35 args.health_arg = argv.next_if(|opt| !opt.starts_with('-'));
34 }
36 }
37+ "--fetch-grammars" => args.fetch_grammars = true,
38+ "--build-grammars" => args.build_grammars = true,
35 arg if arg.starts_with("--") => {
39 arg if arg.starts_with("--") => {
36 anyhow::bail!("unexpected double dash argument: {}", arg)
40 anyhow::bail!("unexpected double dash argument: {}", arg)
37 }
41 }
helix-term/src/main.rs+10−8
@@ -59,14 +59,16 @@ ARGS:
59 <files>... Sets the input file to use, position can also be specified via file[:row[:col]]
59 <files>... Sets the input file to use, position can also be specified via file[:row[:col]]
60
60
61FLAGS:
61FLAGS:
62− -h, --help Prints help information
62+ -h, --help Prints help information
63− --edit-config Opens the helix config file
63+ --edit-config Opens the helix config file
64− --tutor Loads the tutorial
64+ --tutor Loads the tutorial
65− --health [LANG] Checks for potential errors in editor setup
65+ --health [LANG] Checks for potential errors in editor setup
66− If given, checks for config errors in language LANG
66+ If given, checks for config errors in language LANG
67+ --fetch-grammars Fetches tree-sitter grammars listed in languages.toml
68+ --build-grammars Builds tree-sitter grammars fetched with --fetch-grammars
67− -v Increases logging verbosity each use for up to 3 times
69+ -v Increases logging verbosity each use for up to 3 times
68− (default file: {})
70+ (default file: {})
69− -V, --version Prints version information
71+ -V, --version Prints version information
70",
72",
71 env!("CARGO_PKG_NAME"),
73 env!("CARGO_PKG_NAME"),
72 env!("VERSION_AND_GIT_HASH"),
74 env!("VERSION_AND_GIT_HASH"),