mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
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.
This commit is contained in:
parent
a38b8d0222
commit
7d28da5006
2 changed files with 3 additions and 3 deletions
|
|
@ -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}) )
|
||||
|
|
|
|||
|
|
@ -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}) )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue