check empty command first

This commit is contained in:
Ben Harris 2020-06-11 16:01:01 -04:00
parent 619bc12e6e
commit 61f6f2ccd2
1 changed files with 5 additions and 3 deletions

8
tilde
View File

@ -291,13 +291,15 @@ case $1 in
;;
*)
if [ -x "/tilde/bin/$1" ]; then
if [ -z "$1" ]; then
help_message
exit
elif [ -x "/tilde/bin/$1" ]; then
prog="/tilde/bin/$1"
shift
exec "$prog" "$@"
else
[ -z "$1" ] || \
printf "%s not found. try %s list to see what's available\n" "$1" "$PROGNAME"
printf "%s not found. check %s list to see what's available\n\n" "$1" "$PROGNAME"
help_message
exit
fi