aboutsummaryrefslogtreecommitdiff
path: root/scripts/radamsa.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/radamsa.sh')
-rwxr-xr-xscripts/radamsa.sh17
1 files changed, 14 insertions, 3 deletions
diff --git a/scripts/radamsa.sh b/scripts/radamsa.sh
index c92923dd..dd192b55 100755
--- a/scripts/radamsa.sh
+++ b/scripts/radamsa.sh
@@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
-# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
+# Copyright (c) 2018-2023 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -63,14 +63,25 @@ dir=$(dirname "$script")
. "$dir/functions.sh"
+# Just print the usage and exit with an error. This can receive a message to
+# print.
+# @param 1 A message to print.
+usage() {
+ if [ $# -eq 1 ]; then
+ printf '%s\n\n' "$1"
+ fi
+ printf 'usage: %s dir\n' "$script"
+ exit 1
+}
+
# Command-line processing.
if [ "$#" -lt 1 ]; then
- printf 'usage: %s dir\n' "$0"
- exit 1
+ usage "Not enough arguments"
fi
d="$1"
shift
+check_d_arg "$d"
bcdir="$dir/../bin"