Update help/usage formatting.

This commit is contained in:
William Melody 2016-01-26 20:25:16 -08:00
parent f8564cfb2f
commit f7c7aef173
8 changed files with 33 additions and 33 deletions

View File

@ -41,16 +41,16 @@ curl -L https://raw.github.com/alphabetum/hosts/master/hosts \
```text ```text
Usage: Usage:
hosts hosts
hosts add <ip> <hostname> [comment] hosts add <ip> <hostname> [<comment>]
hosts disable ( <ip> | <hostname> | <search string> ) hosts disable (<ip> | <hostname> | <search string>)
hosts disabled hosts disabled
hosts edit hosts edit
hosts enable ( <ip> | <hostname> | <search string> ) hosts enable (<ip> | <hostname> | <search string>)
hosts enabled hosts enabled
hosts file hosts file
hosts list [enabled | disabled | <search string>] hosts list [enabled | disabled | <search string>]
hosts show ( <ip> | <hostname> | <search string> ) hosts show (<ip> | <hostname> | <search string>)
hosts remove ( <ip> | <hostname> | <search string> ) [--force] hosts remove (<ip> | <hostname> | <search string>) [--force]
``` ```
For full usage, run: For full usage, run:
@ -67,11 +67,11 @@ hosts help <command name>
## Commands ## Commands
###### `hosts add <ip> <hostname> [comment]` ###### `hosts add <ip> <hostname> [<comment>]`
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 remove (<ip> | <hostname> | <search string>) [--force]`
Remove one or more records based on a given IP address, hostname, or search Remove one or more records based on a given IP address, hostname, or search
string. When the `--force` option is used, the confirmation prompt is string. When the `--force` option is used, the confirmation prompt is
@ -83,11 +83,11 @@ List the existing IP / hostname pairs, optionally limited to a specified
state. When provided with a seach string, all matching enabled records will state. When provided with a seach string, all matching enabled records will
be printed. be printed.
###### `hosts show ( <ip> | <hostname> | <search string> )` ###### `hosts show (<ip> | <hostname> | <search string>)`
Print entries matching a given IP address, hostname, or search string. Print entries matching a given IP address, hostname, or search string.
###### `hosts disable ( <ip> | <hostname> | <search string> )` ###### `hosts disable (<ip> | <hostname> | <search string>)`
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.
@ -96,7 +96,7 @@ search string.
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 enable (<ip> | <hostname> | <search string>)`
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.

22
hosts
View File

@ -551,7 +551,7 @@ _print_desc() {
desc "version" <<EOM desc "version" <<EOM
Usage: Usage:
$_ME ( version | --version ) $_ME (version | --version)
Description: Description:
Display the current program version. Display the current program version.
@ -587,16 +587,16 @@ Version: $_VERSION
Usage: Usage:
$_ME $_ME
$_ME add <ip> <hostname> [comment] $_ME add <ip> <hostname> [<comment>]
$_ME disable ( <ip> | <hostname> | <search string> ) $_ME disable (<ip> | <hostname> | <search string>)
$_ME disabled $_ME disabled
$_ME edit $_ME edit
$_ME enable ( <ip> | <hostname> | <search string> ) $_ME enable (<ip> | <hostname> | <search string>)
$_ME enabled $_ME enabled
$_ME file $_ME file
$_ME list [enabled | disabled | <search string>] $_ME list [enabled | disabled | <search string>]
$_ME show ( <ip> | <hostname> | <search string> ) $_ME show (<ip> | <hostname> | <search string>)
$_ME remove ( <ip> | <hostname> | <search string> ) [--force] $_ME remove (<ip> | <hostname> | <search string>) [--force]
$_ME -h | --help $_ME -h | --help
$_ME --version $_ME --version
@ -667,7 +667,7 @@ commands() {
desc "add" <<EOM desc "add" <<EOM
Usage: Usage:
$_ME add <ip> <hostname> [comment] $_ME add <ip> <hostname> [<comment>]
Description: 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.
@ -725,7 +725,7 @@ add() {
desc "disable" <<EOM desc "disable" <<EOM
Usage: Usage:
$_ME disable ( <ip> | <hostname> | <search string> ) $_ME disable (<ip> | <hostname> | <search string>)
Description: 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
@ -811,7 +811,7 @@ edit() {
desc "enable" <<EOM desc "enable" <<EOM
Usage: Usage:
$_ME enable ( <ip> | <hostname> | <search string> ) $_ME enable (<ip> | <hostname> | <search string>)
Description: 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,
@ -931,7 +931,7 @@ list() {
desc "remove" <<EOM desc "remove" <<EOM
Usage: Usage:
$_ME remove ( <ip> | <hostname> | <search string> ) [--force] $_ME remove (<ip> | <hostname> | <search string>) [--force]
$_ME remove <ip> <hostname> $_ME remove <ip> <hostname>
Options: Options:
@ -1066,7 +1066,7 @@ remove() {
desc "show" <<EOM desc "show" <<EOM
Usage: Usage:
$_ME show ( <ip> | <hostname> | <search string> ) $_ME show (<ip> | <hostname> | <search string>)
Description: Description:
Print entries matching a given IP address, hostname, or search string. Print entries matching a given IP address, hostname, or search string.

View File

@ -25,7 +25,7 @@ load test_helper
printf "\$status: %s\n" "$status" printf "\$status: %s\n" "$status"
printf "\$output: '%s'\n" "$output" printf "\$output: '%s'\n" "$output"
[[ "${lines[0]}" == "Usage:" ]] [[ "${lines[0]}" == "Usage:" ]]
[[ "${lines[1]}" == " hosts add <ip> <hostname> [comment]" ]] [[ "${lines[1]}" == " hosts add <ip> <hostname> [<comment>]" ]]
} }
# `hosts add <ip>` ############################################################ # `hosts add <ip>` ############################################################
@ -52,7 +52,7 @@ load test_helper
printf "\$output: '%s'\n" "$output" printf "\$output: '%s'\n" "$output"
[[ "${lines[0]}" == "Please include a hostname" ]] [[ "${lines[0]}" == "Please include a hostname" ]]
[[ "${lines[1]}" == "Usage:" ]] [[ "${lines[1]}" == "Usage:" ]]
[[ "${lines[2]}" == " hosts add <ip> <hostname> [comment]" ]] [[ "${lines[2]}" == " hosts add <ip> <hostname> [<comment>]" ]]
} }
# `hosts add <ip> <hostname>` ################################################# # `hosts add <ip> <hostname>` #################################################
@ -123,5 +123,5 @@ load test_helper
printf "\$status: %s\n" "$status" printf "\$status: %s\n" "$status"
printf "\$output: '%s'\n" "$output" printf "\$output: '%s'\n" "$output"
[[ "${lines[0]}" == "Usage:" ]] [[ "${lines[0]}" == "Usage:" ]]
[[ "${lines[1]}" == " hosts add <ip> <hostname> [comment]" ]] [[ "${lines[1]}" == " hosts add <ip> <hostname> [<comment>]" ]]
} }

View File

@ -25,7 +25,7 @@ load test_helper
printf "\$status: %s\n" "$status" printf "\$status: %s\n" "$status"
printf "\$output: '%s'\n" "$output" printf "\$output: '%s'\n" "$output"
[[ "${lines[0]}" == "Usage:" ]] [[ "${lines[0]}" == "Usage:" ]]
[[ "${lines[1]}" == " hosts disable ( <ip> | <hostname> | <search string> )" ]] [[ "${lines[1]}" == " hosts disable (<ip> | <hostname> | <search string>)" ]]
} }
# `hosts disable <ip>` ######################################################## # `hosts disable <ip>` ########################################################
@ -154,5 +154,5 @@ load test_helper
printf "\$status: %s\n" "$status" printf "\$status: %s\n" "$status"
printf "\$output: '%s'\n" "$output" printf "\$output: '%s'\n" "$output"
[[ "${lines[0]}" == "Usage:" ]] [[ "${lines[0]}" == "Usage:" ]]
[[ "${lines[1]}" == " hosts disable ( <ip> | <hostname> | <search string> )" ]] [[ "${lines[1]}" == " hosts disable (<ip> | <hostname> | <search string>)" ]]
} }

View File

@ -25,7 +25,7 @@ load test_helper
printf "\$status: %s\n" "$status" printf "\$status: %s\n" "$status"
printf "\$output: '%s'\n" "$output" printf "\$output: '%s'\n" "$output"
[[ "${lines[0]}" == "Usage:" ]] [[ "${lines[0]}" == "Usage:" ]]
[[ "${lines[1]}" == " hosts enable ( <ip> | <hostname> | <search string> )" ]] [[ "${lines[1]}" == " hosts enable (<ip> | <hostname> | <search string>)" ]]
} }
# `hosts enable <ip>` ######################################################### # `hosts enable <ip>` #########################################################
@ -201,5 +201,5 @@ load test_helper
printf "\$status: %s\n" "$status" printf "\$status: %s\n" "$status"
printf "\$output: '%s'\n" "$output" printf "\$output: '%s'\n" "$output"
[[ "${lines[0]}" == "Usage:" ]] [[ "${lines[0]}" == "Usage:" ]]
[[ "${lines[1]}" == " hosts enable ( <ip> | <hostname> | <search string> )" ]] [[ "${lines[1]}" == " hosts enable (<ip> | <hostname> | <search string>)" ]]
} }

View File

@ -25,7 +25,7 @@ load test_helper
printf "\$status: %s\n" "$status" printf "\$status: %s\n" "$status"
printf "\$output: '%s'\n" "$output" printf "\$output: '%s'\n" "$output"
[[ "${lines[0]}" == "Usage:" ]] [[ "${lines[0]}" == "Usage:" ]]
[[ "${lines[1]}" == " hosts remove ( <ip> | <hostname> | <search string> ) [--force]" ]] [[ "${lines[1]}" == " hosts remove (<ip> | <hostname> | <search string>) [--force]" ]]
} }
# `hosts remove <invalid> --force` ############################################ # `hosts remove <invalid> --force` ############################################
@ -223,5 +223,5 @@ Removed:
printf "\$status: %s\n" "$status" printf "\$status: %s\n" "$status"
printf "\$output: '%s'\n" "$output" printf "\$output: '%s'\n" "$output"
[[ "${lines[0]}" == "Usage:" ]] [[ "${lines[0]}" == "Usage:" ]]
[[ "${lines[1]}" == " hosts remove ( <ip> | <hostname> | <search string> ) [--force]" ]] [[ "${lines[1]}" == " hosts remove (<ip> | <hostname> | <search string>) [--force]" ]]
} }

View File

@ -16,7 +16,7 @@ load test_helper
printf "\$status: %s\n" "$status" printf "\$status: %s\n" "$status"
printf "\$output: '%s'\n" "$output" printf "\$output: '%s'\n" "$output"
[[ "${lines[0]}" == "Usage:" ]] [[ "${lines[0]}" == "Usage:" ]]
[[ "${lines[1]}" == " hosts show ( <ip> | <hostname> | <search string> )" ]] [[ "${lines[1]}" == " hosts show (<ip> | <hostname> | <search string>)" ]]
} }
# `hosts show <ip>` ######################################################### # `hosts show <ip>` #########################################################
@ -95,5 +95,5 @@ load test_helper
printf "\$status: %s\n" "$status" printf "\$status: %s\n" "$status"
printf "\$output: '%s'\n" "$output" printf "\$output: '%s'\n" "$output"
[[ "${lines[0]}" == "Usage:" ]] [[ "${lines[0]}" == "Usage:" ]]
[[ "${lines[1]}" == " hosts show ( <ip> | <hostname> | <search string> )" ]] [[ "${lines[1]}" == " hosts show (<ip> | <hostname> | <search string>)" ]]
} }

View File

@ -36,5 +36,5 @@ load test_helper
printf "\$status: %s\n" "$status" printf "\$status: %s\n" "$status"
printf "\$output: '%s'\n" "$output" printf "\$output: '%s'\n" "$output"
[[ "${lines[0]}" == "Usage:" ]] [[ "${lines[0]}" == "Usage:" ]]
[[ "${lines[1]}" == " hosts ( version | --version )" ]] [[ "${lines[1]}" == " hosts (version | --version)" ]]
} }