diff --git a/README.md b/README.md index cd114ab..d9a5275 100644 --- a/README.md +++ b/README.md @@ -417,7 +417,7 @@ Description: Add a given IP address and hostname pair, along with an optional comment. Exit status: - 0 Success. + 0 Entry successfully added. 1 Invalid parameters or entry exists. ``` @@ -462,7 +462,7 @@ Description: for IPv4 and both `fe80::1%lo0` and `::1` for IPv6. Exit status: - 0 Success. + 0 successfully blocked. 1 Invalid parameters or entry exists. ``` @@ -483,6 +483,10 @@ Options: Description: Manage completion scripts. For more information, visit: https://github.com/xwmx/hosts/blob/master/etc/README.md + +Exit status: + 0 Completions successfully installed. + 1 Invalid parameters or other error. ``` ### `hosts disable` @@ -496,7 +500,7 @@ Description: search string. Exit status: - 0 Success. + 0 Entry successfully disabled. 1 Invalid parameters or entry not found. ``` @@ -531,7 +535,7 @@ Description: or search string. Exit status: - 0 Success. + 0 Entry successfully enabled. 1 Invalid parameters or entry not found. ``` @@ -593,7 +597,7 @@ Description: IP and hostname pair will be removed. Exit status: - 0 Success. + 0 Entry successfully removed. 1 Invalid parameters or entry not found. ``` @@ -605,6 +609,10 @@ Usage: Description: Search entries for . + +Exit status: + 0 One or more matching entries found. + 1 Invalid parameters or entry not found. ``` ### `hosts show` @@ -617,7 +625,7 @@ Description: Print entries matching a given IP address, hostname, or search string. Exit status: - 0 Success. + 0 One or more matching entries found. 1 Invalid parameters or entry not found. ``` @@ -644,7 +652,7 @@ Description: Unblock one or more hostnames by removing the entries from the hosts file. Exit status: - 0 Success. + 0 successfully unblocked. 1 Invalid parameters or entry not found ``` diff --git a/hosts b/hosts index af7caaf..a516d1f 100755 --- a/hosts +++ b/hosts @@ -543,7 +543,7 @@ Description: Add a given IP address and hostname pair, along with an optional comment. Exit status: - 0 Success. + 0 Entry successfully added. 1 Invalid parameters or entry exists. HEREDOC add() { @@ -774,7 +774,7 @@ Description: for IPv4 and both \`fe80::1%lo0\` and \`::1\` for IPv6. Exit status: - 0 Success. + 0 successfully blocked. 1 Invalid parameters or entry exists. HEREDOC block() { @@ -807,6 +807,10 @@ Options: Description: Manage completion scripts. For more information, visit: https://github.com/${_REPO}/blob/master/etc/README.md + +Exit status: + 0 Completions successfully installed. + 1 Invalid parameters or other error. HEREDOC completions() { local _BASH_COMP_NAME="hosts" @@ -1064,7 +1068,7 @@ Description: search string. Exit status: - 0 Success. + 0 Entry successfully disabled. 1 Invalid parameters or entry not found. HEREDOC disable() { @@ -1163,7 +1167,7 @@ Description: or search string. Exit status: - 0 Success. + 0 Entry successfully enabled. 1 Invalid parameters or entry not found. HEREDOC enable() { @@ -1306,7 +1310,7 @@ Description: IP and hostname pair will be removed. Exit status: - 0 Success. + 0 Entry successfully removed. 1 Invalid parameters or entry not found. HEREDOC remove() { @@ -1448,6 +1452,10 @@ Usage: Description: Search entries for . + +Exit status: + 0 One or more matching entries found. + 1 Invalid parameters or entry not found. HEREDOC search() { if [[ -z "${1:-}" ]] @@ -1469,7 +1477,7 @@ Description: Print entries matching a given IP address, hostname, or search string. Exit status: - 0 Success. + 0 One or more matching entries found. 1 Invalid parameters or entry not found. HEREDOC show() { @@ -1541,7 +1549,7 @@ Description: Unblock one or more hostnames by removing the entries from the hosts file. Exit status: - 0 Success. + 0 successfully unblocked. 1 Invalid parameters or entry not found. HEREDOC unblock() { diff --git a/test/search.bats b/test/search.bats index c430cc6..e565853 100644 --- a/test/search.bats +++ b/test/search.bats @@ -34,7 +34,11 @@ Usage: hosts search Description: - Search entries for ." + Search entries for . + +Exit status: + 0 One or more matching entries found. + 1 Invalid parameters or entry not found." _compare "'${_expected}'" "'${output}'" [[ "${output}" == "${_expected}" ]] }