From f5c8b6290efbbdea6ae27311049dfe4af1429b7f Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Fri, 26 Feb 2021 21:50:53 +0100 Subject: [PATCH] Show the usage message when -p/--printresult is repeated. --- scripts/ybcon.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/ybcon.sh b/scripts/ybcon.sh index 2b878da..f3e37a4 100755 --- a/scripts/ybcon.sh +++ b/scripts/ybcon.sh @@ -17,6 +17,7 @@ usage() { fi } +pUsed=false args=""; run=false; skipArgsIteration=false; @@ -48,8 +49,13 @@ if [ "$#" != 0 ]; then usage false exit 0 ;; -p | --printresult ) - newArgs "$it" - shift ;; + if [ $pUsed = false ]; then + pUsed=true + newArgs "$it" + else + usage false + exit 0 + fi ;; *.ybcon ) newArgs "$it" run=true