mirror of
https://github.com/octoleo/hosts.git
synced 2025-01-01 05:31:49 +00:00
Use $DEFAULT_COMMAND pattern from bash-boilerplate
This is more verbose, but consistent with bash-boilerplate's approach.
This commit is contained in:
parent
8889e26255
commit
10704e2bd7
8
hosts
8
hosts
@ -131,6 +131,12 @@ IFS="$SAFER_IFS"
|
||||
|
||||
_VERSION="0.1.0-alpha"
|
||||
|
||||
# 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}"
|
||||
|
||||
###############################################################################
|
||||
# Debug
|
||||
###############################################################################
|
||||
@ -401,7 +407,7 @@ _main() {
|
||||
|
||||
# If $cmd is blank, then set to help
|
||||
if [[ -z $cmd ]]; then
|
||||
cmd="list"
|
||||
cmd="$DEFAULT_COMMAND"
|
||||
fi
|
||||
|
||||
# Load all of the commands.
|
||||
|
Loading…
Reference in New Issue
Block a user