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

Rename commands to subcommands.

This commit is contained in:
William Melody 2020-06-07 14:44:10 -07:00
parent c3be802faf
commit 8ab47640f0

47
hosts
View File

@ -743,28 +743,6 @@ block() {
done
}
# commands ########################################################### commands
desc "commands" <<HEREDOC
Usage:
${_ME} commands [--raw]
Options:
--raw Display the command list without formatting.
Description:
Display the list of available commands.
HEREDOC
commands() {
if [[ "${1:-}" == "--raw" ]]
then
printf "%s\\n" "${_DEFINED_SUBCOMMANDS[@]}"
else
printf "Available commands:\\n"
printf " %s\\n" "${_DEFINED_SUBCOMMANDS[@]}"
fi
}
# completions ##################################################### completions
desc "completions" <<HEREDOC
@ -1464,6 +1442,30 @@ show() {
fi
}
# subcommands ##################################################### subcommands
desc "subcommands" <<HEREDOC
Usage:
${_ME} subcommands [--raw]
Options:
--raw Display the subcommand list without formatting.
Description:
Display the list of available subcommands.
HEREDOC
subcommands() {
if [[ "${1:-}" == "--raw" ]]
then
printf "%s\\n" "${_DEFINED_SUBCOMMANDS[@]}"
else
printf "Available subcommands:\\n"
printf " %s\\n" "${_DEFINED_SUBCOMMANDS[@]}"
fi
}
desc "commands" "$(desc --get 'subcommands')"
commands() { subcommands "${@}"; }
# unblock ############################################################# unblock
desc "unblock" <<HEREDOC
@ -1539,6 +1541,7 @@ _SUBCOMMANDS=(
delete
search
show
subcommands
unblock
version
)