From 5c2fbc51103003c477d0fdcaf90dc6bb40922b3c Mon Sep 17 00:00:00 2001 From: John Axel Eriksson Date: Tue, 12 Aug 2014 14:48:08 +0200 Subject: [PATCH] cmdarg_info so it checks for anything NOT in flags The cmdarg_info function should check whether the input is NOT in flags rather than the other way around. Otherwise it will fail every time when doing one is actually doing the right thing. --- cmdarg.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmdarg.sh b/cmdarg.sh index b1e0f3d..282b05c 100644 --- a/cmdarg.sh +++ b/cmdarg.sh @@ -102,7 +102,7 @@ function cmdarg_info # Sets various flags about your script that are printed during cmdarg_usage # local flags="header|copyright|footer|author" - if [[ "$1" =~ $flags ]]; then + if [[ ! "$1" =~ $flags ]]; then echo "cmdarg_info " >&2 echo "Where is one of $flags" >&2 ${CMDARG_ERROR_BEHAVIOR} 1