use builtin "command -v" instead of which (#308)
This commit is contained in:
4
todo.sh
4
todo.sh
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user