]> code.ossystems Code Review - openembedded-core.git/commitdiff
build-perf-test-wrapper.sh: check for positional arguments
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 29 Sep 2016 17:10:08 +0000 (20:10 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 30 Sep 2016 16:14:12 +0000 (17:14 +0100)
Stricter checking of command line arguments. The script doesn't use any
positional arguments so don't accept any and error out if those are
found.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/contrib/build-perf-test-wrapper.sh

index d61e4389331a442b4b5479f39bee8bb13221fc47..90dd5454955964d25327fc9a9839acc1c6e441f6 100755 (executable)
@@ -57,6 +57,14 @@ while getopts "ha:c:C:w:" opt; do
     esac
 done
 
+# Check positional args
+shift "$((OPTIND - 1))"
+if [ $# -ne 0 ]; then
+    echo "ERROR: No positional args are accepted."
+    usage
+    exit 1
+fi
+
 echo "Running on `uname -n`"
 if ! git_topdir=$(git rev-parse --show-toplevel); then
         echo "The current working dir doesn't seem to be a git clone. Please cd there before running `basename $0`"