mirror of
https://github.com/octoleo/hosts.git
synced 2024-11-21 20:35:10 +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 #####################################################################
|
# help ################################################################### help
|
||||||
|
|
||||||
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 ########################################################################
|
|
||||||
|
|
||||||
desc "help" <<HEREDOC
|
desc "help" <<HEREDOC
|
||||||
Usage:
|
Usage:
|
||||||
@ -545,28 +530,6 @@ HEREDOC
|
|||||||
fi
|
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
|
# Commands
|
||||||
# ========.....................................................................
|
# ========.....................................................................
|
||||||
@ -856,6 +819,28 @@ block() {
|
|||||||
done
|
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
|
# completions ##################################################### completions
|
||||||
|
|
||||||
desc "completions" <<HEREDOC
|
desc "completions" <<HEREDOC
|
||||||
@ -1586,6 +1571,21 @@ unblock() {
|
|||||||
done
|
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
|
# Options
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
Loading…
Reference in New Issue
Block a user