mirror of
https://github.com/octoleo/hosts.git
synced 2024-11-24 13:47:35 +00:00
Support full list
operations in hosts
with no subcommand.
This commit is contained in:
parent
05ba7bdc03
commit
6c0254895f
16
README.md
16
README.md
@ -40,7 +40,7 @@ curl -L https://raw.github.com/alphabetum/hosts/master/hosts \
|
||||
|
||||
```text
|
||||
Usage:
|
||||
hosts
|
||||
hosts [<search string>]
|
||||
hosts add <ip> <hostname> [<comment>]
|
||||
hosts block <hostname>
|
||||
hosts disable (<ip> | <hostname> | <search string>)
|
||||
@ -81,6 +81,20 @@ hosts help <command name>
|
||||
|
||||
## Commands
|
||||
|
||||
## `hosts`
|
||||
|
||||
```text
|
||||
Usage:
|
||||
hosts [<search string>]
|
||||
|
||||
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
|
||||
|
8
hosts
8
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} [<search string>]
|
||||
${_ME} add <ip> <hostname> [<comment>]
|
||||
${_ME} block <hostname>
|
||||
${_ME} disable (<ip> | <hostname> | <search string>)
|
||||
|
Loading…
Reference in New Issue
Block a user