From eb486a915f4d686285d9c75844582697f5540f4c Mon Sep 17 00:00:00 2001 From: Nik Revenco Date: Wed, 2 Jul 2025 15:01:04 +0100 Subject: [PATCH] feat: rename `-x` short flag to `-e` --- contrib/completion/hx.bash | 2 +- contrib/completion/hx.elv | 2 +- contrib/completion/hx.fish | 1 + contrib/completion/hx.nu | 2 +- contrib/completion/hx.zsh | 2 +- helix-term/src/args.rs | 2 +- helix-term/src/main.rs | 2 +- 7 files changed, 7 insertions(+), 6 deletions(-) diff --git a/contrib/completion/hx.bash b/contrib/completion/hx.bash index af08f7e0d..f5473cac6 100644 --- a/contrib/completion/hx.bash +++ b/contrib/completion/hx.bash @@ -21,7 +21,7 @@ _hx() { case "$2" in -*) - mapfile -t COMPREPLY < <(compgen -W "-h --help --tutor -V --version -v -vv -vvv --health -g --grammar --vsplit --hsplit -x --execute -c --config --log" -- """$2""") + mapfile -t COMPREPLY < <(compgen -W "-h --help --tutor -V --version -v -vv -vvv --health -g --grammar --vsplit --hsplit -e --execute -c --config --log" -- """$2""") return 0 ;; *) diff --git a/contrib/completion/hx.elv b/contrib/completion/hx.elv index df2a46d1b..f8a72beaf 100644 --- a/contrib/completion/hx.elv +++ b/contrib/completion/hx.elv @@ -50,7 +50,7 @@ set edit:completion:arg-completer[hx] = {|@args| $candidate "--grammar" "(Fetch or build the tree-sitter grammars)" $candidate "--vsplit" "(Splits all given files vertically)" $candidate "--hsplit" "(Splits all given files horizontally)" - $candidate "-x" "(Executes the given command on startup)" + $candidate "-e" "(Executes the given command on startup)" $candidate "--execute" "(Executes the given command on startup)" $candidate "--config" "(Specifies a file to use for configuration)" $candidate "--log" "(Specifies a file to write log data into)" diff --git a/contrib/completion/hx.fish b/contrib/completion/hx.fish index f05dba8dd..01f92be5e 100644 --- a/contrib/completion/hx.fish +++ b/contrib/completion/hx.fish @@ -12,6 +12,7 @@ complete -c hx -l hsplit -d "Splits all given files horizontally" complete -c hx -s c -l config -r -d "Specifies a file to use for config" complete -c hx -l log -r -d "Specifies a file to use for logging" complete -c hx -s w -l working-dir -d "Specify initial working directory" -xa "(__fish_complete_directories)" +complete -c hx -s e -l execute -d "Executes the given command on startup" function __hx_langs_ops hx --health languages | tail -n '+2' | string replace -fr '^(\S+) .*' '$1' diff --git a/contrib/completion/hx.nu b/contrib/completion/hx.nu index 8bd8ff1d0..4d5f28b9c 100644 --- a/contrib/completion/hx.nu +++ b/contrib/completion/hx.nu @@ -24,7 +24,7 @@ export extern hx [ --version(-V), # Prints version information --vsplit, # Splits all given files vertically into different windows --hsplit, # Splits all given files horizontally into different windows - --execute(-x), # Executes the given command on startup + --execute(-e), # Executes the given command on startup --working-dir(-w): glob, # Specify an initial working directory ...files: glob, # Sets the input file to use, position can also be specified via file[:row[:col]] ] diff --git a/contrib/completion/hx.zsh b/contrib/completion/hx.zsh index d91eb59be..305e9870d 100644 --- a/contrib/completion/hx.zsh +++ b/contrib/completion/hx.zsh @@ -18,7 +18,7 @@ _hx() { "--hsplit[Splits all given files horizontally]" \ "-c[Specifies a file to use for configuration]" \ "--config[Specifies a file to use for configuration]" \ - "-x[Executes the given command on startup]" \ + "-e[Executes the given command on startup]" \ "--execute[Executes the given command on startup]" \ "-w[Specify initial working directory]" \ "--working-dir[Specify initial working directory]" \ diff --git a/helix-term/src/args.rs b/helix-term/src/args.rs index dba0b755b..a907d6f33 100644 --- a/helix-term/src/args.rs +++ b/helix-term/src/args.rs @@ -76,7 +76,7 @@ impl Args { Some(path) => args.log_file = Some(path.into()), None => anyhow::bail!("--log must specify a path to write"), }, - "-x" | "--execute" => { + "-e" | "--execute" => { if let Some(command) = argv.next().as_deref() { args.execute = helix_view::input::parse_macro(command)?; } else { diff --git a/helix-term/src/main.rs b/helix-term/src/main.rs index 79ec6f7cc..cc5b08190 100644 --- a/helix-term/src/main.rs +++ b/helix-term/src/main.rs @@ -76,7 +76,7 @@ FLAGS: --hsplit Splits all given files horizontally into different windows -w, --working-dir Specify an initial working directory +N Open the first given file at line number N - -x, --execute Executes the given command on startup + -e, --execute Executes the given command on startup ", env!("CARGO_PKG_NAME"), VERSION_AND_GIT_HASH,