summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2016-04-01 07:44:35 +0200
committerSébastien Helleu <flashcode@flashtux.org>2016-04-01 07:44:35 +0200
commit7235e89c0fb5a7e2ea0459a46115f179f58e3418 (patch)
tree767c9601563f9ec31679a0ddbdc64eedf6866922
parent25cc82685c1d26aa2d73cdb199875fe37926fc7a (diff)
downloadweechat-7235e89c0fb5a7e2ea0459a46115f179f58e3418.zip
core: add return code in usage function (debian build script)
-rwxr-xr-xtools/build-debian.sh10
1 files 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|<version> 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