From 7235e89c0fb5a7e2ea0459a46115f179f58e3418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Fri, 1 Apr 2016 07:44:35 +0200 Subject: [PATCH] core: add return code in usage function (debian build script) --- tools/build-debian.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/build-debian.sh b/tools/build-debian.sh index 4eed8d357..8db925839 100755 --- a/tools/build-debian.sh +++ b/tools/build-debian.sh @@ -56,8 +56,9 @@ DEFAULT_PACKAGER_NAME="Sébastien Helleu" DEFAULT_PACKAGER_EMAIL="flashcode@flashtux.org" DEFAULT_JOBS="" -display_usage () +usage () { + RC=$1 cat <<-EOF Syntax: $0 devel|stable| distro @@ -79,6 +80,7 @@ Examples: $0 1.4-2 ubuntu/wily EOF + exit ${RC} } error () @@ -90,8 +92,7 @@ error () error_usage () { echo >&2 "ERROR: $*" - display_usage - exit 1 + usage 1 } # ================================== START ================================== @@ -114,6 +115,9 @@ fi cd "${ROOT_DIR}" # check command line arguments +if [ $# -eq 0 ]; then + usage 0 +fi if [ $# -lt 2 ]; then error_usage "missing arguments" fi