From 0dcee1cad33c8a890b1714707cf361e612df15bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Fri, 26 Jan 2018 13:05:02 +0100 Subject: [PATCH] [rt46602] Clean up getopts usage Ensure case clauses are in sync with the string passed to getopts. Remove catch-all clauses as they will never be evaluated. --- bin/tests/system/clean.sh | 1 - bin/tests/system/run.sh | 3 +-- bin/tests/system/runall.sh | 1 - bin/tests/system/testsummary.sh | 1 - 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/bin/tests/system/clean.sh b/bin/tests/system/clean.sh index 84c369e0af..a53724917c 100644 --- a/bin/tests/system/clean.sh +++ b/bin/tests/system/clean.sh @@ -24,7 +24,6 @@ runall=0 while getopts "r" flag; do case $flag in r) runall=1 ;; - *) exit 1;; esac done shift `expr $OPTIND - 1` diff --git a/bin/tests/system/run.sh b/bin/tests/system/run.sh index 549313bf50..9a7e472a42 100644 --- a/bin/tests/system/run.sh +++ b/bin/tests/system/run.sh @@ -17,13 +17,12 @@ stopservers=true clean=true baseport=5300 -while getopts "rnp:d:" flag; do +while getopts "knp:r" flag; do case "$flag" in k) stopservers=false ;; n) clean=false ;; p) baseport=$OPTARG ;; r) runall="-r" ;; - *) exit 1 ;; esac done shift `expr $OPTIND - 1` diff --git a/bin/tests/system/runall.sh b/bin/tests/system/runall.sh index c28296dad7..54da64ea52 100644 --- a/bin/tests/system/runall.sh +++ b/bin/tests/system/runall.sh @@ -25,7 +25,6 @@ usage="Usage: ./runall.sh [-n] [numprocesses]" while getopts "n" flag; do case "$flag" in n) CLEANFLAG="NOCLEAN=-n" ;; - *) echo "$usage" >&2 ; exit 1 ;; esac done shift `expr $OPTIND - 1` diff --git a/bin/tests/system/testsummary.sh b/bin/tests/system/testsummary.sh index 45beed8ab2..8b046b61cb 100644 --- a/bin/tests/system/testsummary.sh +++ b/bin/tests/system/testsummary.sh @@ -29,7 +29,6 @@ keepfile=0 while getopts "n" flag; do case $flag in n) keepfile=1 ;; - *) exit 1 ;; esac done