aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Barnes <craigbarnes@protonmail.com>2023-01-10 18:34:25 +0000
committerCraig Barnes <craigbarnes@protonmail.com>2023-01-10 18:34:25 +0000
commit7d28da50066601807b6790bbd77e2d8785e46884 (patch)
treea64f4a3073ec4d1d7f6578647ad4c0863a038e02
parentdoc: fix a typo (diff)
Use "command -v" instead of "which" in bash completion scripts
The former is a built-in command in bash, whereas the latter is an external command and isn't always necessarily available.
-rw-r--r--completions/bash/foot4
-rw-r--r--completions/bash/footclient2
2 files changed, 3 insertions, 3 deletions
diff --git a/completions/bash/foot b/completions/bash/foot
index 1fdab062..b427bc58 100644
--- a/completions/bash/foot
+++ b/completions/bash/foot
@@ -61,11 +61,11 @@ _foot()
compopt -o dirnames
elif [[ ${prev} == '--term' ]] ; then
# check if toe is available
- which toe > /dev/null || return 1
+ command -v toe > /dev/null || return 1
COMPREPLY=( $(compgen -W "$(toe -a | awk '$1 ~ /[+]/ {next}; {print $1}')" -- ${cur}) )
elif [[ ${prev} == '--font' ]] ; then
# check if fc-list is available
- which fc-list > /dev/null || return 1
+ command -v fc-list > /dev/null || return 1
COMPREPLY=( $(compgen -W "$(fc-list : family | sed 's/,/\n/g' | uniq | tr -d ' ')" -- ${cur}) )
elif [[ ${prev} == '--log-level' ]] ; then
COMPREPLY=( $(compgen -W "none error warning info" -- ${cur}) )
diff --git a/completions/bash/footclient b/completions/bash/footclient
index b672c247..0381e8a0 100644
--- a/completions/bash/footclient
+++ b/completions/bash/footclient
@@ -57,7 +57,7 @@ _footclient()
compopt -o dirnames
elif [[ ${prev} == '--term' ]] ; then
# check if toe is available
- which toe > /dev/null || return 1
+ command -v toe > /dev/null || return 1
COMPREPLY=( $(compgen -W "$(toe -a | awk '$1 ~ /[+]/ {next}; {print $1}')" -- ${cur}) )
elif [[ ${prev} == '--log-level' ]] ; then
COMPREPLY=( $(compgen -W "none error warning info" -- ${cur}) )