format error messages

This commit is contained in:
Robert Kaussow 2020-02-03 23:05:30 +01:00
parent 71def01f9d
commit d17c23172a
1 changed files with 4 additions and 4 deletions

View File

@ -35,7 +35,7 @@ wait_for() {
fi fi
sleep 1 sleep 1
done done
echo "Operation timed out" >&2 echo "error: operation timed out" >&2
exit 1 exit 1
} }
@ -68,19 +68,19 @@ do
usage 0 usage 0
;; ;;
*) *)
echoerr "Unknown argument: $1" echoerr "unknown argument: $1"
usage 1 usage 1
;; ;;
esac esac
done done
if ! [ -x "$(command -v nc)" ]; then if ! [ -x "$(command -v nc)" ]; then
echoerr "Error: netcat is required for wait-for to run." echoerr "error: netcat is required for wait-for to run"
exit 1 exit 1
fi fi
if [ "$WAITFOR_HOST" = "" ] || [ "$WAITFOR_PORT" = "" ]; then if [ "$WAITFOR_HOST" = "" ] || [ "$WAITFOR_PORT" = "" ]; then
echoerr "Error: you need to provide a host and port to test." echoerr "error: you need to provide a host and port to test"
usage 2 usage 2
fi fi