From f7c7aef17332943307ba5505678fa22ead9a3ae6 Mon Sep 17 00:00:00 2001 From: William Melody Date: Tue, 26 Jan 2016 20:25:16 -0800 Subject: [PATCH] Update help/usage formatting. --- Readme.md | 20 ++++++++++---------- hosts | 22 +++++++++++----------- test/add.bats | 6 +++--- test/disable.bats | 4 ++-- test/enable.bats | 4 ++-- test/remove.bats | 4 ++-- test/show.bats | 4 ++-- test/version.bats | 2 +- 8 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Readme.md b/Readme.md index 0aa6491..facf105 100644 --- a/Readme.md +++ b/Readme.md @@ -41,16 +41,16 @@ curl -L https://raw.github.com/alphabetum/hosts/master/hosts \ ```text Usage: hosts - hosts add [comment] - hosts disable ( | | ) + hosts add [] + hosts disable ( | | ) hosts disabled hosts edit - hosts enable ( | | ) + hosts enable ( | | ) hosts enabled hosts file hosts list [enabled | disabled | ] - hosts show ( | | ) - hosts remove ( | | ) [--force] + hosts show ( | | ) + hosts remove ( | | ) [--force] ``` For full usage, run: @@ -67,11 +67,11 @@ hosts help ## Commands -###### `hosts add [comment]` +###### `hosts add []` Add a given IP address and hostname pair, along with an optional comment. -###### `hosts remove ( | | ) [--force]` +###### `hosts remove ( | | ) [--force]` 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 @@ -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 be printed. -###### `hosts show ( | | )` +###### `hosts show ( | | )` Print entries matching a given IP address, hostname, or search string. -###### `hosts disable ( | | )` +###### `hosts disable ( | | )` Disable one or more records based on a given ip address, hostname, or search string. @@ -96,7 +96,7 @@ search string. List all disabled records. This is an alias for `hosts list disabled`. -###### `hosts enable ( | | )` +###### `hosts enable ( | | )` Enable one or more disabled records based on a given ip address, hostname, or search string. diff --git a/hosts b/hosts index 48af93b..a250235 100755 --- a/hosts +++ b/hosts @@ -551,7 +551,7 @@ _print_desc() { desc "version" < [comment] - $_ME disable ( | | ) + $_ME add [] + $_ME disable ( | | ) $_ME disabled $_ME edit - $_ME enable ( | | ) + $_ME enable ( | | ) $_ME enabled $_ME file $_ME list [enabled | disabled | ] - $_ME show ( | | ) - $_ME remove ( | | ) [--force] + $_ME show ( | | ) + $_ME remove ( | | ) [--force] $_ME -h | --help $_ME --version @@ -667,7 +667,7 @@ commands() { desc "add" < [comment] + $_ME add [] Description: Add a given IP address and hostname pair, along with an optional comment. @@ -725,7 +725,7 @@ add() { desc "disable" < | | ) + $_ME disable ( | | ) Description: Disable one or more records based on a given ip address, hostname, or @@ -811,7 +811,7 @@ edit() { desc "enable" < | | ) + $_ME enable ( | | ) Description: Enable one or more disabled records based on a given ip address, hostname, @@ -931,7 +931,7 @@ list() { desc "remove" < | | ) [--force] + $_ME remove ( | | ) [--force] $_ME remove Options: @@ -1066,7 +1066,7 @@ remove() { desc "show" < | | ) + $_ME show ( | | ) Description: Print entries matching a given IP address, hostname, or search string. diff --git a/test/add.bats b/test/add.bats index 0b88031..71732d0 100644 --- a/test/add.bats +++ b/test/add.bats @@ -25,7 +25,7 @@ load test_helper printf "\$status: %s\n" "$status" printf "\$output: '%s'\n" "$output" [[ "${lines[0]}" == "Usage:" ]] - [[ "${lines[1]}" == " hosts add [comment]" ]] + [[ "${lines[1]}" == " hosts add []" ]] } # `hosts add ` ############################################################ @@ -52,7 +52,7 @@ load test_helper printf "\$output: '%s'\n" "$output" [[ "${lines[0]}" == "Please include a hostname" ]] [[ "${lines[1]}" == "Usage:" ]] - [[ "${lines[2]}" == " hosts add [comment]" ]] + [[ "${lines[2]}" == " hosts add []" ]] } # `hosts add ` ################################################# @@ -123,5 +123,5 @@ load test_helper printf "\$status: %s\n" "$status" printf "\$output: '%s'\n" "$output" [[ "${lines[0]}" == "Usage:" ]] - [[ "${lines[1]}" == " hosts add [comment]" ]] + [[ "${lines[1]}" == " hosts add []" ]] } diff --git a/test/disable.bats b/test/disable.bats index 7d7aebc..6216f71 100644 --- a/test/disable.bats +++ b/test/disable.bats @@ -25,7 +25,7 @@ load test_helper printf "\$status: %s\n" "$status" printf "\$output: '%s'\n" "$output" [[ "${lines[0]}" == "Usage:" ]] - [[ "${lines[1]}" == " hosts disable ( | | )" ]] + [[ "${lines[1]}" == " hosts disable ( | | )" ]] } # `hosts disable ` ######################################################## @@ -154,5 +154,5 @@ load test_helper printf "\$status: %s\n" "$status" printf "\$output: '%s'\n" "$output" [[ "${lines[0]}" == "Usage:" ]] - [[ "${lines[1]}" == " hosts disable ( | | )" ]] + [[ "${lines[1]}" == " hosts disable ( | | )" ]] } diff --git a/test/enable.bats b/test/enable.bats index fcfb823..77c76b5 100644 --- a/test/enable.bats +++ b/test/enable.bats @@ -25,7 +25,7 @@ load test_helper printf "\$status: %s\n" "$status" printf "\$output: '%s'\n" "$output" [[ "${lines[0]}" == "Usage:" ]] - [[ "${lines[1]}" == " hosts enable ( | | )" ]] + [[ "${lines[1]}" == " hosts enable ( | | )" ]] } # `hosts enable ` ######################################################### @@ -201,5 +201,5 @@ load test_helper printf "\$status: %s\n" "$status" printf "\$output: '%s'\n" "$output" [[ "${lines[0]}" == "Usage:" ]] - [[ "${lines[1]}" == " hosts enable ( | | )" ]] + [[ "${lines[1]}" == " hosts enable ( | | )" ]] } diff --git a/test/remove.bats b/test/remove.bats index 24b70a5..d7f2488 100644 --- a/test/remove.bats +++ b/test/remove.bats @@ -25,7 +25,7 @@ load test_helper printf "\$status: %s\n" "$status" printf "\$output: '%s'\n" "$output" [[ "${lines[0]}" == "Usage:" ]] - [[ "${lines[1]}" == " hosts remove ( | | ) [--force]" ]] + [[ "${lines[1]}" == " hosts remove ( | | ) [--force]" ]] } # `hosts remove --force` ############################################ @@ -223,5 +223,5 @@ Removed: printf "\$status: %s\n" "$status" printf "\$output: '%s'\n" "$output" [[ "${lines[0]}" == "Usage:" ]] - [[ "${lines[1]}" == " hosts remove ( | | ) [--force]" ]] + [[ "${lines[1]}" == " hosts remove ( | | ) [--force]" ]] } diff --git a/test/show.bats b/test/show.bats index 5caa4d6..937e4c2 100644 --- a/test/show.bats +++ b/test/show.bats @@ -16,7 +16,7 @@ load test_helper printf "\$status: %s\n" "$status" printf "\$output: '%s'\n" "$output" [[ "${lines[0]}" == "Usage:" ]] - [[ "${lines[1]}" == " hosts show ( | | )" ]] + [[ "${lines[1]}" == " hosts show ( | | )" ]] } # `hosts show ` ######################################################### @@ -95,5 +95,5 @@ load test_helper printf "\$status: %s\n" "$status" printf "\$output: '%s'\n" "$output" [[ "${lines[0]}" == "Usage:" ]] - [[ "${lines[1]}" == " hosts show ( | | )" ]] + [[ "${lines[1]}" == " hosts show ( | | )" ]] } diff --git a/test/version.bats b/test/version.bats index 1a2bc74..ad14e4f 100644 --- a/test/version.bats +++ b/test/version.bats @@ -36,5 +36,5 @@ load test_helper printf "\$status: %s\n" "$status" printf "\$output: '%s'\n" "$output" [[ "${lines[0]}" == "Usage:" ]] - [[ "${lines[1]}" == " hosts ( version | --version )" ]] + [[ "${lines[1]}" == " hosts (version | --version)" ]] }