mirror of
https://github.com/octoleo/hosts.git
synced 2025-01-06 07:30:42 +00:00
Expand help documentation in README.md
Output formatted to markdown with: for __command in "$(hosts commands --raw)" do printf "### \`hosts %s\`\n" "${__command}" printf "\n" printf "\`\`\`text\n" hosts help "${__command}" printf "\`\`\`\n" printf "\n" done
This commit is contained in:
parent
347189c059
commit
0bb87f92fe
165
README.md
165
README.md
@ -70,64 +70,179 @@ hosts help <command name>
|
|||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
###### `hosts add <ip> <hostname> [<comment>]`
|
## `hosts add`
|
||||||
|
|
||||||
|
```text
|
||||||
|
Usage:
|
||||||
|
hosts add <ip> <hostname> [<comment>]
|
||||||
|
|
||||||
|
Description:
|
||||||
Add a given IP address and hostname pair, along with an optional comment.
|
Add a given IP address and hostname pair, along with an optional comment.
|
||||||
|
```
|
||||||
|
|
||||||
###### `hosts remove (<ip> | <hostname> | <search string>) [--force]`
|
### `hosts block`
|
||||||
|
|
||||||
Remove one or more records based on a given IP address, hostname, or search
|
```text
|
||||||
string. When the `--force` option is used, the confirmation prompt is
|
Usage:
|
||||||
suppressed.
|
hosts block <hostname>
|
||||||
|
|
||||||
###### `hosts list [enabled | disabled | <search string>]`
|
Description:
|
||||||
|
Block a given hostname by adding new entries assigning it to `127.0.0.1`
|
||||||
|
for IPv4 and both `fe80::1%lo0` and `::1` for IPv6.
|
||||||
|
```
|
||||||
|
|
||||||
List the existing IP / hostname pairs, optionally limited to a specified
|
### `hosts commands`
|
||||||
state. When provided with a search string, all matching enabled records will
|
|
||||||
be printed.
|
|
||||||
|
|
||||||
###### `hosts show (<ip> | <hostname> | <search string>)`
|
```text
|
||||||
|
Usage:
|
||||||
|
hosts commands [--raw]
|
||||||
|
|
||||||
Print entries matching a given IP address, hostname, or search string.
|
Options:
|
||||||
|
--raw Display the command list without formatting.
|
||||||
|
|
||||||
###### `hosts disable (<ip> | <hostname> | <search string>)`
|
Description:
|
||||||
|
Display the list of available commands.
|
||||||
|
```
|
||||||
|
|
||||||
|
### `hosts disable`
|
||||||
|
|
||||||
|
```text
|
||||||
|
Usage:
|
||||||
|
hosts disable (<ip> | <hostname> | <search string>)
|
||||||
|
|
||||||
|
Description:
|
||||||
Disable one or more records based on a given ip address, hostname, or
|
Disable one or more records based on a given ip address, hostname, or
|
||||||
search string.
|
search string.
|
||||||
|
```
|
||||||
|
|
||||||
###### `hosts disabled`
|
### `hosts disabled`
|
||||||
|
|
||||||
|
```text
|
||||||
|
Usage:
|
||||||
|
hosts disabled
|
||||||
|
|
||||||
|
Description:
|
||||||
List all disabled records. This is an alias for `hosts list disabled`.
|
List all disabled records. This is an alias for `hosts list disabled`.
|
||||||
|
```
|
||||||
|
|
||||||
###### `hosts enable (<ip> | <hostname> | <search string>)`
|
### `hosts edit`
|
||||||
|
|
||||||
|
```text
|
||||||
|
Usage:
|
||||||
|
hosts edit
|
||||||
|
|
||||||
|
Description:
|
||||||
|
Open the /etc/hosts file in your $EDITOR.
|
||||||
|
```
|
||||||
|
|
||||||
|
### `hosts enable`
|
||||||
|
|
||||||
|
```text
|
||||||
|
Usage:
|
||||||
|
hosts enable (<ip> | <hostname> | <search string>)
|
||||||
|
|
||||||
|
Description:
|
||||||
Enable one or more disabled records based on a given ip address, hostname,
|
Enable one or more disabled records based on a given ip address, hostname,
|
||||||
or search string.
|
or search string.
|
||||||
|
```
|
||||||
|
|
||||||
###### `hosts enabled`
|
### `hosts enabled`
|
||||||
|
|
||||||
|
```text
|
||||||
|
Usage:
|
||||||
|
hosts enabled
|
||||||
|
|
||||||
|
Description:
|
||||||
List all enabled records. This is an alias for `hosts list enabled`.
|
List all enabled records. This is an alias for `hosts list enabled`.
|
||||||
|
```
|
||||||
|
|
||||||
###### `hosts edit`
|
### `hosts file`
|
||||||
|
|
||||||
Open the hosts file (/etc/hosts) file in your editor.
|
```text
|
||||||
|
Usage:
|
||||||
###### `hosts file`
|
hosts file
|
||||||
|
|
||||||
|
Description:
|
||||||
Print the entire contents of the /etc/hosts file.
|
Print the entire contents of the /etc/hosts file.
|
||||||
|
```
|
||||||
|
|
||||||
###### `hosts search <search string>`
|
### `hosts help`
|
||||||
|
|
||||||
Search entries for a given search string.
|
```text
|
||||||
|
Usage:
|
||||||
|
hosts help [<command>]
|
||||||
|
|
||||||
###### `block <hostname>`
|
Description:
|
||||||
|
Display help information for hosts or a specified command.
|
||||||
|
```
|
||||||
|
|
||||||
Block a given hostname by adding new entries assigning it to `127.0.0.1` for
|
### `hosts list`
|
||||||
IPv4 and both `fe80::1%lo0` and `::1` for IPv6.
|
|
||||||
|
|
||||||
###### `unblock <hostname>`
|
```text
|
||||||
|
Usage:
|
||||||
|
hosts list [enabled | disabled | <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.
|
||||||
|
```
|
||||||
|
|
||||||
|
### `hosts remove`
|
||||||
|
|
||||||
|
```text
|
||||||
|
Usage:
|
||||||
|
hosts remove (<ip> | <hostname> | <search string>) [--force]
|
||||||
|
hosts remove <ip> <hostname>
|
||||||
|
|
||||||
|
Options:
|
||||||
|
--force Skip the confirmation prompt.
|
||||||
|
|
||||||
|
Description:
|
||||||
|
Remove one or more records based on a given IP address, hostname, or search
|
||||||
|
string. If an IP and hostname are both provided, only records matching the
|
||||||
|
IP and hostname pair will be removed.
|
||||||
|
```
|
||||||
|
|
||||||
|
### `hosts search`
|
||||||
|
|
||||||
|
```text
|
||||||
|
Usage:
|
||||||
|
hosts search <search string>
|
||||||
|
|
||||||
|
Description:
|
||||||
|
Search entries for <search string>.
|
||||||
|
```
|
||||||
|
|
||||||
|
### `hosts show`
|
||||||
|
|
||||||
|
```text
|
||||||
|
Usage:
|
||||||
|
hosts show (<ip> | <hostname> | <search string>)
|
||||||
|
|
||||||
|
Description:
|
||||||
|
Print entries matching a given IP address, hostname, or search string.
|
||||||
|
```
|
||||||
|
|
||||||
|
### `hosts unblock`
|
||||||
|
|
||||||
|
```text
|
||||||
|
Usage:
|
||||||
|
hosts unblock <hostname>
|
||||||
|
|
||||||
|
Description:
|
||||||
Unblock a given hostname by removing its entries from the hosts file.
|
Unblock a given hostname by removing its entries from the hosts file.
|
||||||
|
```
|
||||||
|
|
||||||
|
### `hosts version`
|
||||||
|
|
||||||
|
```text
|
||||||
|
Usage:
|
||||||
|
hosts (version | --version)
|
||||||
|
|
||||||
|
Description:
|
||||||
|
Display the current program version.
|
||||||
|
```
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user