diff --git a/scripts/ybcon.sh b/scripts/ybcon.sh index b546005..5544b16 100755 --- a/scripts/ybcon.sh +++ b/scripts/ybcon.sh @@ -17,7 +17,11 @@ usage() { fi } -pUsed=false +usageExit() { + usage false + exit 0 +} + args=""; run=false; skipArgsIteration=false; @@ -48,21 +52,18 @@ if [ "$#" != 0 ]; then do case "$it" in -h | --help | --version ) - usage false - exit 0 ;; + usageExit ;; -p | --printresult ) - if [ $pUsed = false ]; then - pUsed=true + if test "${args#*$it}" = "$args"; then newArgs "$it" else - usage false - exit 0 + usageExit fi ;; *.ybcon ) newArgs "$it" run=true ;; * ) - usage false ;; + usageExit ;; esac done fi