File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ function foo() {
2929
3030 exitIfArgIsNotArray arr 1
3131 exitIfArgIsNotArrayOrIsEmpty arr 1
32+ exitIfArgIsNotArrayOrIsNonEmpty arr 1
3233 exitIfArgIsNotFunction " $fn " 2
3334 exitIfArgIsNotBoolean " $bool " 3
3435 exitIfArgIsNotVersion " $version " 4
Original file line number Diff line number Diff line change @@ -132,6 +132,16 @@ function exitIfArgIsNotArrayOrIsEmpty() {
132132 fi
133133}
134134
135+ function exitIfArgIsNotArrayOrIsNonEmpty() {
136+ exitIfArgIsNotArray " $@ "
137+ local -rn exitIfArgIsNotArrayOrIsNonEmpty_arr=$1
138+ local -r argNumberOrName=$2
139+ shift 2 || traceAndDie " could not shift by 2"
140+ if [[ ${# exitIfArgIsNotArrayOrIsNonEmpty_arr[@]} -gt 0 ]]; then
141+ traceAndDie " the passed argument \033[0;36m%s\033[0m is a non empty array" " ${! checkArgIsArray_arr} "
142+ fi
143+ }
144+
135145function checkArgIsArrayWithTuples() {
136146 if (( $# != 5 )) ; then
137147 logError " Five arguments need to be passed to checkArgIsArrayWithTuples, given \033[0;36m%s\033[0m\n" " $# "
You can’t perform that action at this time.
0 commit comments