diff options
Diffstat (limited to 'helix-term')
-rw-r--r-- | helix-term/src/args.rs | 9 | ||||
-rw-r--r-- | helix-term/src/main.rs | 19 |
2 files changed, 16 insertions, 12 deletions
diff --git a/helix-term/src/args.rs b/helix-term/src/args.rs index 80076528..e0f0af00 100644 --- a/helix-term/src/args.rs +++ b/helix-term/src/args.rs @@ -34,8 +34,13 @@ 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, + "-g" | "--grammar" => match argv.next().as_deref() { + Some("fetch") => args.fetch_grammars = true, + Some("build") => args.build_grammars = true, + _ => { + anyhow::bail!("--grammar must be followed by either 'fetch' or 'build'") + } + }, 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 a69e121b..6511e004 100644 --- a/helix-term/src/main.rs +++ b/helix-term/src/main.rs @@ -59,16 +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 - --edit-config Opens the helix config file - --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 + -h, --help Prints help information + --edit-config Opens the helix config file + --tutor Loads the tutorial + --health [LANG] Checks for potential errors in editor setup + If given, checks for config errors in language LANG + -g, --grammars {{fetch|build}} Fetches or builds tree-sitter grammars listed in languages.toml + -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"), |