diff --git a/README.md b/README.md index 1f213b8..0abbe6b 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ curl -L https://raw.github.com/alphabetum/hosts/master/hosts \ ```text Usage: - hosts + hosts [] hosts add [] hosts block hosts disable ( | | ) @@ -81,6 +81,20 @@ hosts help ## Commands +## `hosts` + +```text +Usage: + hosts [] + +Description: + List the existing IP / hostname pairs, optionally limited to a specified + state. When provided with a seach string, all matching enabled records will + be printed. + + Alias for `hosts list` +``` + ## `hosts add` ```text diff --git a/hosts b/hosts index 5895889..5a80737 100755 --- a/hosts +++ b/hosts @@ -373,7 +373,11 @@ _main() { # Pass all comment arguments to the program except for the first ($0). ${_CMD} "${_COMMAND_PARAMETERS[@]:-}" else - _die printf "Unknown command: %s\n" "${_CMD}" + local _parameters=() + _parameters+=("${_CMD}") + _parameters+=(${_COMMAND_PARAMETERS[@]:-}) + + "${DEFAULT_COMMAND}" "${_parameters[@]:-}" fi } @@ -605,7 +609,7 @@ A program for managing host file entries. Version: ${_VERSION} Usage: - ${_ME} + ${_ME} [] ${_ME} add [] ${_ME} block ${_ME} disable ( | | )