1
0
mirror of https://github.com/octoleo/hosts.git synced 2024-11-21 20:35:10 +00:00

Rename $DEFAULT_COMMAND to $HOSTS_DEFAULT_COMMAND.

This commit is contained in:
William Melody 2017-03-01 20:21:06 -08:00
parent 6c0254895f
commit db7ac727f1

13
hosts
View File

@ -38,11 +38,12 @@ IFS=$'\n\t'
_VERSION="2.3.1"
# DEFAULT_COMMAND
# $HOSTS_DEFAULT_COMMAND
#
# The command to be run by default, when no command name is specified. If the
# environment has an existing $DEFAULT_COMMAND set, then that value is used.
DEFAULT_COMMAND="${DEFAULT_COMMAND:-list}"
# environment has an existing `$HOSTS_DEFAULT_COMMAND` set, then that value is
# used.
HOSTS_DEFAULT_COMMAND="${HOSTS_DEFAULT_COMMAND:-list}"
# HOSTS_PATH
#
@ -358,10 +359,10 @@ _main() {
_debug printf "main(): entering...\n"
_debug printf "main() \${_CMD} (upon entering): %s\n" "${_CMD}"
# If $_CMD is blank, then set to `$DEFAULT_COMMAND`
# If $_CMD is blank, then set to `$HOSTS_DEFAULT_COMMAND`
if [[ -z ${_CMD} ]]
then
_CMD="${DEFAULT_COMMAND}"
_CMD="${HOSTS_DEFAULT_COMMAND}"
fi
# Load all of the commands.
@ -377,7 +378,7 @@ _main() {
_parameters+=("${_CMD}")
_parameters+=(${_COMMAND_PARAMETERS[@]:-})
"${DEFAULT_COMMAND}" "${_parameters[@]:-}"
"${HOSTS_DEFAULT_COMMAND}" "${_parameters[@]:-}"
fi
}