scripts/check-config.sh: Add usage()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 11 Dec 2018 16:22:28 +0000 (18:22 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 26 Dec 2018 23:24:26 +0000 (18:24 -0500)
When arguments are not supplied the error message is misleading and
doesn't tell what exactly has to be done.

Fix this by adding usage() and call it if above circumstance occurs.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
scripts/check-config.sh

index 4848ca6..583f7d0 100755 (executable)
 set -e
 set -u
 
+PROG_NAME="${0##*/}"
+
+usage() {
+       echo "$PROG_NAME <path to u-boot.cfg> <path to whitelist file> <source dir>"
+       exit 1
+}
+
+[ $# -ge 3 ] || usage
+
 path="$1"
 whitelist="$2"
 srctree="$3"