[CRIU] [PATCH 10/12] test/zdtm.sh: move unrecognized option to inside case

Kir Kolyshkin kir at openvz.org
Fri Sep 13 14:47:07 EDT 2013


Easier that way

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 test/zdtm.sh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/test/zdtm.sh b/test/zdtm.sh
index 3eb8085..a045522 100755
--- a/test/zdtm.sh
+++ b/test/zdtm.sh
@@ -696,6 +696,10 @@ while :; do
 		usage
 		exit 0
 		;;
+	  -*)
+		echo "Unrecognized option $1, aborting!" 1>&2
+		exit 1
+		;;
 	  *)
 		break
 		;;
@@ -706,9 +710,7 @@ if [ $COMPILE_ONLY -eq 0 ]; then
 	check_criu || exit 1
 fi
 
-if [ "${1:0:1}" = '-' ]; then
-	echo "unrecognized option $1"
-elif [ $SPECIFIED_NAME_USED -eq 1 ]; then
+if [ $SPECIFIED_NAME_USED -eq 1 ]; then
 	if [ $# -eq 0 ]; then
 		echo "test name should be provided"
 		exit 1
-- 
1.8.1.4



More information about the CRIU mailing list