Added test to cover the case when cmdarg_purge erases or otherwise makes the cmdarg_cfg internals unusable, also changed the purge method to something much simpler

This commit is contained in:
2013-11-01 14:16:59 -04:00
parent f9e71bffe3
commit 16548e463b
2 changed files with 27 additions and 7 deletions

View File

@@ -324,12 +324,7 @@ function cmdarg_purge
arrays="$arrays CMDARG_FLAGS CMDARG_TYPES"
for arr in $arrays
do
str='${!'"$arr"'[@]}'
for key in $(eval "echo $str")
do
str="$arr[$key]"
eval "unset $str"
done
eval "$arr=()"
done
CMDARG_GETOPTLIST="h"
}