From d2bbce787871c67cdcfe1e614b90f96e1c3217f3 Mon Sep 17 00:00:00 2001 From: Adriaan Knapen Date: Fri, 12 Mar 2021 14:35:25 +0200 Subject: [PATCH] fix: correctly render the command name in the help text Previously the help text failed to render the name of the script being executed in the help text. The issue was detected by shellcheck, this commit also includes another minor fix detected by ShellCheck. Closes #16 --- wait-for | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wait-for b/wait-for index 43ed61b..e87f981 100755 --- a/wait-for +++ b/wait-for @@ -36,7 +36,7 @@ usage() { exitcode="$1" cat << USAGE >&2 Usage: - $cmdname host:port|url [-t timeout] [-- command args] + $0 host:port|url [-t timeout] [-- command args] -q | --quiet Do not output any status messages -t TIMEOUT | --timeout=timeout Timeout in seconds, zero for no timeout -- COMMAND ARGS Execute command with args after the test finishes @@ -168,7 +168,7 @@ fi case "$PROTOCOL" in tcp) - if [ "$HOST" = "" -o "$PORT" = "" ]; then + if [ "$HOST" = "" ] || [ "$PORT" = "" ]; then echoerr "Error: you need to provide a host and port to test." usage 2 fi