1
0
mirror of https://github.com/octoleo/hosts.git synced 2024-05-28 12:20:47 +00:00

Simplify help argument handling.

This commit is contained in:
William Melody 2018-05-14 21:19:36 -07:00
parent dfcb37b3b6
commit 0c11a1939e

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
}