Simplify `help` argument handling.

This commit is contained in:
William Melody 2018-05-14 21:19:36 -07:00
parent dfcb37b3b6
commit 0c11a1939e
1 changed files with 3 additions and 3 deletions

6
hosts
View File

@ -561,8 +561,10 @@ Description:
Display help information for ${_ME} or a specified command.
HEREDOC
help() {
if [[ ${#_COMMAND_ARGV[@]} = 1 ]]
if [[ -n "${1:-}" ]]
then
desc --get "${1}"
else
cat <<HEREDOC
__ __
/ /_ ____ _____/ /______
@ -603,8 +605,6 @@ Help:
$(commands)
HEREDOC
else
desc --get "${1}"
fi
}