[oe-commits] [openembedded-core] 22/30: build-perf-test-wrapper.sh: check for positional arguments

git at git.openembedded.org git at git.openembedded.org
Fri Sep 30 16:16:27 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 4725ee8e4e4837446dfa3a319eb68cc9572c55eb
Author: Markus Lehtonen <markus.lehtonen at linux.intel.com>
AuthorDate: Thu Sep 29 20:10:08 2016 +0300

    build-perf-test-wrapper.sh: check for positional arguments
    
    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 at linux.intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 scripts/contrib/build-perf-test-wrapper.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/scripts/contrib/build-perf-test-wrapper.sh b/scripts/contrib/build-perf-test-wrapper.sh
index d61e438..90dd545 100755
--- a/scripts/contrib/build-perf-test-wrapper.sh
+++ b/scripts/contrib/build-perf-test-wrapper.sh
@@ -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`"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list