mirror of
https://github.com/octoleo/hosts.git
synced 2024-11-24 21:57:35 +00:00
Rearrange commands in script.
This commit is contained in:
parent
5865f92977
commit
a64c20bdd8
78
hosts
78
hosts
@ -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
|
||||
###############################################################################
|
||||
|
Loading…
Reference in New Issue
Block a user