From 308e38279f11d2496d82a8e0f1440f2fb4af4296 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Wed, 9 Oct 2013 13:27:05 -0400 Subject: [PATCH] Added a few new functions for dumping config state, also added new facilities for specifying that certain config options should be an array or a hash --- cmdarg.sh | 186 +++++++++++++++++++++++++++++++++++++++++++++++------- test.sh | 15 +++++ 2 files changed, 179 insertions(+), 22 deletions(-) create mode 100644 test.sh diff --git a/cmdarg.sh b/cmdarg.sh index 4e275ea..d63b19a 100644 --- a/cmdarg.sh +++ b/cmdarg.sh @@ -6,8 +6,15 @@ if [ $bashversion -lt 4 ]; then exit 1 fi + +CMDARG_FLAG_NOARG=0 CMDARG_FLAG_WITHARG=1 +CMDARG_TYPE_ARRAY=1 +CMDARG_TYPE_HASH=2 +CMDARG_TYPE_STRING=3 +CMDARG_TYPE_BOOLEAN=4 + function cmdarg { # cmdarg