mirror of
https://github.com/octoleo/hosts.git
synced 2025-02-11 14:58:27 +00:00
Quote arguments to help
.
This commit is contained in:
parent
16a672d52a
commit
2f6290f3d4
23
hosts
23
hosts
@ -697,12 +697,12 @@ add() {
|
|||||||
|
|
||||||
if [[ -z "${_ip:-}" ]]
|
if [[ -z "${_ip:-}" ]]
|
||||||
then
|
then
|
||||||
help add
|
help "add"
|
||||||
exit 1
|
exit 1
|
||||||
elif [[ -z "${_hostname:-}" ]]
|
elif [[ -z "${_hostname:-}" ]]
|
||||||
then
|
then
|
||||||
printf "Please include a hostname\\n"
|
printf "Please include a hostname\\n"
|
||||||
help add
|
help "add"
|
||||||
exit 1
|
exit 1
|
||||||
elif grep \
|
elif grep \
|
||||||
-e "^${_ip}[[:space:]]\+${_hostname}$" \
|
-e "^${_ip}[[:space:]]\+${_hostname}$" \
|
||||||
@ -812,7 +812,7 @@ backups() {
|
|||||||
compare)
|
compare)
|
||||||
if [[ -z "${_filename:-}" ]]
|
if [[ -z "${_filename:-}" ]]
|
||||||
then
|
then
|
||||||
help backups
|
help "backups"
|
||||||
exit 1
|
exit 1
|
||||||
elif [[ ! -e "${_hosts_dirname}/${_filename}" ]]
|
elif [[ ! -e "${_hosts_dirname}/${_filename}" ]]
|
||||||
then
|
then
|
||||||
@ -825,7 +825,7 @@ backups() {
|
|||||||
delete)
|
delete)
|
||||||
if [[ -z "${_filename:-}" ]]
|
if [[ -z "${_filename:-}" ]]
|
||||||
then
|
then
|
||||||
help backups
|
help "backups"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -844,7 +844,7 @@ backups() {
|
|||||||
restore)
|
restore)
|
||||||
if [[ -z "${_filename:-}" ]]
|
if [[ -z "${_filename:-}" ]]
|
||||||
then
|
then
|
||||||
help backups
|
help "backups"
|
||||||
exit 1
|
exit 1
|
||||||
elif [[ ! -e "${_hosts_dirname}/${_filename}" ]]
|
elif [[ ! -e "${_hosts_dirname}/${_filename}" ]]
|
||||||
then
|
then
|
||||||
@ -865,7 +865,7 @@ backups() {
|
|||||||
show)
|
show)
|
||||||
if [[ -z "${_filename:-}" ]]
|
if [[ -z "${_filename:-}" ]]
|
||||||
then
|
then
|
||||||
help backups
|
help "backups"
|
||||||
exit 1
|
exit 1
|
||||||
elif [[ ! -e "${_hosts_dirname}/${_filename}" ]]
|
elif [[ ! -e "${_hosts_dirname}/${_filename}" ]]
|
||||||
then
|
then
|
||||||
@ -923,7 +923,7 @@ block() {
|
|||||||
|
|
||||||
if [[ -z "${1:-}" ]]
|
if [[ -z "${1:-}" ]]
|
||||||
then
|
then
|
||||||
help block
|
help "block"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -957,7 +957,7 @@ disable() {
|
|||||||
|
|
||||||
if [[ -z "${_search_string:-}" ]]
|
if [[ -z "${_search_string:-}" ]]
|
||||||
then
|
then
|
||||||
help disable
|
help "disable"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
_debug printf "disable() \${_search_string}: %s\\n" "${_search_string}"
|
_debug printf "disable() \${_search_string}: %s\\n" "${_search_string}"
|
||||||
@ -1055,7 +1055,7 @@ enable() {
|
|||||||
|
|
||||||
if [[ -z "${_search_string:-}" ]]
|
if [[ -z "${_search_string:-}" ]]
|
||||||
then
|
then
|
||||||
help enable
|
help "enable"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
_debug printf "enable() \${_search_string}: %s\\n" "${_search_string}"
|
_debug printf "enable() \${_search_string}: %s\\n" "${_search_string}"
|
||||||
@ -1220,7 +1220,7 @@ remove() {
|
|||||||
|
|
||||||
if [[ -z "${_arguments[0]:-}" ]]
|
if [[ -z "${_arguments[0]:-}" ]]
|
||||||
then
|
then
|
||||||
help remove
|
help "remove"
|
||||||
exit 1
|
exit 1
|
||||||
elif [[ -n "${_arguments[1]:-}" ]]
|
elif [[ -n "${_arguments[1]:-}" ]]
|
||||||
then
|
then
|
||||||
@ -1334,7 +1334,8 @@ HEREDOC
|
|||||||
search() {
|
search() {
|
||||||
if _blank "${_COMMAND_ARGV[1]:-}"
|
if _blank "${_COMMAND_ARGV[1]:-}"
|
||||||
then
|
then
|
||||||
_return_1 help "search"
|
help "search"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
list "$@"
|
list "$@"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user