mirror of
https://github.com/octoleo/hosts.git
synced 2024-12-01 01:03:56 +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
|
```text
|
||||||
Usage:
|
Usage:
|
||||||
hosts
|
hosts [<search string>]
|
||||||
hosts add <ip> <hostname> [<comment>]
|
hosts add <ip> <hostname> [<comment>]
|
||||||
hosts block <hostname>
|
hosts block <hostname>
|
||||||
hosts disable (<ip> | <hostname> | <search string>)
|
hosts disable (<ip> | <hostname> | <search string>)
|
||||||
@ -81,6 +81,20 @@ hosts help <command name>
|
|||||||
|
|
||||||
## Commands
|
## 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`
|
## `hosts add`
|
||||||
|
|
||||||
```text
|
```text
|
||||||
|
8
hosts
8
hosts
@ -373,7 +373,11 @@ _main() {
|
|||||||
# Pass all comment arguments to the program except for the first ($0).
|
# Pass all comment arguments to the program except for the first ($0).
|
||||||
${_CMD} "${_COMMAND_PARAMETERS[@]:-}"
|
${_CMD} "${_COMMAND_PARAMETERS[@]:-}"
|
||||||
else
|
else
|
||||||
_die printf "Unknown command: %s\n" "${_CMD}"
|
local _parameters=()
|
||||||
|
_parameters+=("${_CMD}")
|
||||||
|
_parameters+=(${_COMMAND_PARAMETERS[@]:-})
|
||||||
|
|
||||||
|
"${DEFAULT_COMMAND}" "${_parameters[@]:-}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -605,7 +609,7 @@ A program for managing host file entries.
|
|||||||
Version: ${_VERSION}
|
Version: ${_VERSION}
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
${_ME}
|
${_ME} [<search string>]
|
||||||
${_ME} add <ip> <hostname> [<comment>]
|
${_ME} add <ip> <hostname> [<comment>]
|
||||||
${_ME} block <hostname>
|
${_ME} block <hostname>
|
||||||
${_ME} disable (<ip> | <hostname> | <search string>)
|
${_ME} disable (<ip> | <hostname> | <search string>)
|
||||||
|
Loading…
Reference in New Issue
Block a user