From 28fea3a599c2d623a6b248a223a200d65b755c4d Mon Sep 17 00:00:00 2001 From: William Melody Date: Sun, 7 Jun 2020 14:39:18 -0700 Subject: [PATCH] Rename global variable to `$HOSTS_DEFAULT_SUBCOMMAND`. --- hosts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hosts b/hosts index 1e0fe43..5ad7b06 100755 --- a/hosts +++ b/hosts @@ -59,10 +59,12 @@ _VERSION="3.5.1" # This program's basename. _ME="$(basename "${0}")" -# $HOSTS_DEFAULT_COMMAND +# $HOSTS_DEFAULT_SUBCOMMAND # # The command to be run by default, when no command name is specified. -HOSTS_DEFAULT_COMMAND="${HOSTS_DEFAULT_COMMAND:-list}" +[[ -n "${HOSTS_DEFAULT_COMMAND:-}" ]] && + HOSTS_DEFAULT_SUBCOMMAND="${HOSTS_DEFAULT_COMMAND}" +HOSTS_DEFAULT_SUBCOMMAND="${HOSTS_DEFAULT_SUBCOMMAND:-list}" # $HOSTS_PATH # @@ -1650,7 +1652,7 @@ _main() { if [[ -z "${_SUBCOMMAND}" ]] then - _SUBCOMMAND="${HOSTS_DEFAULT_COMMAND}" + _SUBCOMMAND="${HOSTS_DEFAULT_SUBCOMMAND}" fi _load_commands