aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/args.rs
diff options
context:
space:
mode:
authorMichael Davis2022-03-08 06:13:15 +0000
committerBlaž Hrastnik2022-03-10 08:31:57 +0000
commit7044d7d804ad798207594e1b3bb5bd80a96d3da0 (patch)
tree2456d38b7e586641005da7f867e85d7df62cca15 /helix-term/src/args.rs
parent37520f46ae891f77f81f4049cbb7dc2dbe2d5fc3 (diff)
rename '--fetch/build-grammars' flags into '--grammar fetch/build'
The old flags were a bit long. --grammar is also aliased to -g to make it even easier.
Diffstat (limited to 'helix-term/src/args.rs')
-rw-r--r--helix-term/src/args.rs9
1 files changed, 7 insertions, 2 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)
}