File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ echoerr() { if [[ $QUIET -ne 1 ]]; then echo "$@" 1>&2; fi }
77
88usage ()
99{
10- cat << USAGE >&2
10+ [[ $1 ]] && out=2 || out=1
11+ cat << USAGE >&$out
1112Usage:
1213 $cmdname host:port [-s] [-t timeout] [-- command args]
1314 -h HOST | --host=HOST Host or IP under test
1920 Timeout in seconds, zero for no timeout
2021 -- COMMAND ARGS Execute command with args after the test finishes
2122USAGE
22- exit 1
23+ exit ${1 :- 0}
2324}
2425
2526wait_for ()
126127 ;;
127128 * )
128129 echoerr " Unknown argument: $1 "
129- usage
130+ usage 1
130131 ;;
131132 esac
132133done
133134
134135if [[ " $HOST " == " " || " $PORT " == " " ]]; then
135136 echoerr " Error: you need to provide a host and port to test."
136- usage
137+ usage 1
137138fi
138139
139140TIMEOUT=${TIMEOUT:- 15}
You can’t perform that action at this time.
0 commit comments