dbuild: s/usage/die/

Suggested-by: Dejan Mircevski <dejan@scylladb.com>
> The use pattern of this function strongly suggests a name like `die`.

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
Message-Id: <20191223085219.1253342-2-bhalevy@scylladb.com>
This commit is contained in:
Benny Halevy
2019-12-23 10:52:17 +02:00
committed by Avi Kivity
parent 718e9eb341
commit 87b2f189f7

View File

@@ -46,9 +46,12 @@ EOF
exit 0
}
function usage () {
function die () {
msg="$1"
if [[ -n "$msg" ]]; then
echo "$(basename $0): $msg." 1>&2
fi
cat <<EOF 1>&2
$1
Run \`$0 --help' to print the full help message.
EOF
@@ -71,7 +74,7 @@ elif [[ "$1" = -* ]]; then
exec docker image ls
fi
if ! docker image inspect "$image" >/dev/null; then
usage
die
fi
continue
;;
@@ -92,7 +95,7 @@ elif [[ "$1" = -* ]]; then
shift
done
if [[ "$1" != "--" ]]; then
usage "Expected '--' to terminate docker flag list"
die "Expected '--' to terminate docker flag list"
fi
shift
fi