Rearrange commands in script.

This commit is contained in:
William Melody 2020-06-07 13:43:04 -07:00
parent 5865f92977
commit a64c20bdd8
1 changed files with 39 additions and 39 deletions

78
hosts
View File

@ -469,25 +469,10 @@ HEREDOC
}
###############################################################################
# Default Commands
# Help
###############################################################################
# Version #####################################################################
desc "version" <<HEREDOC
Usage:
${_ME} (version | --version)
Description:
Display the current program version.
To save you the trouble, the current version is ${_VERSION}
HEREDOC
version() {
printf "%s\\n" "${_VERSION}"
}
# Help ########################################################################
# help ################################################################### help
desc "help" <<HEREDOC
Usage:
@ -545,28 +530,6 @@ HEREDOC
fi
}
# Command List ################################################################
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_COMMANDS[@]}"
else
printf "Available commands:\\n"
printf " %s\\n" "${_DEFINED_COMMANDS[@]}"
fi
}
###############################################################################
# Commands
# ========.....................................................................
@ -856,6 +819,28 @@ 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_COMMANDS[@]}"
else
printf "Available commands:\\n"
printf " %s\\n" "${_DEFINED_COMMANDS[@]}"
fi
}
# completions ##################################################### completions
desc "completions" <<HEREDOC
@ -1586,6 +1571,21 @@ unblock() {
done
}
# version ############################################################# version
desc "version" <<HEREDOC
Usage:
${_ME} (version | --version)
Description:
Display the current program version.
To save you the trouble, the current version is ${_VERSION}
HEREDOC
version() {
printf "%s\\n" "${_VERSION}"
}
###############################################################################
# Options
###############################################################################