From 87b2f189f7888a4a1fa6ffbfe4b287c7111dd40c Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Mon, 23 Dec 2019 10:52:17 +0200 Subject: [PATCH] dbuild: s/usage/die/ Suggested-by: Dejan Mircevski > The use pattern of this function strongly suggests a name like `die`. Signed-off-by: Benny Halevy Message-Id: <20191223085219.1253342-2-bhalevy@scylladb.com> --- tools/toolchain/dbuild | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/toolchain/dbuild b/tools/toolchain/dbuild index 814c0f082d..d4d4b45891 100755 --- a/tools/toolchain/dbuild +++ b/tools/toolchain/dbuild @@ -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 <&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