use builtin "command -v" instead of which (#308)

This commit is contained in:
Wallysson
2021-08-03 20:10:28 -03:00
committed by GitHub
parent 6ea2b5ae6d
commit 7501d37b45

View File

@@ -1252,7 +1252,7 @@ case $action in
actionUsage "$@" actionUsage "$@"
else else
if [ -t 1 ] ; then # STDOUT is a TTY if [ -t 1 ] ; then # STDOUT is a TTY
if which "${PAGER:-less}" >/dev/null 2>&1; then if command -v "${PAGER:-less}" >/dev/null 2>&1; then
# we have a working PAGER (or less as a default) # we have a working PAGER (or less as a default)
help | "${PAGER:-less}" && exit 0 help | "${PAGER:-less}" && exit 0
fi fi
@@ -1263,7 +1263,7 @@ case $action in
"shorthelp" ) "shorthelp" )
if [ -t 1 ] ; then # STDOUT is a TTY if [ -t 1 ] ; then # STDOUT is a TTY
if which "${PAGER:-less}" >/dev/null 2>&1; then if command -v "${PAGER:-less}" >/dev/null 2>&1; then
# we have a working PAGER (or less as a default) # we have a working PAGER (or less as a default)
shorthelp | "${PAGER:-less}" && exit 0 shorthelp | "${PAGER:-less}" && exit 0
fi fi