Permalink
Browse files

variable is array

  • Loading branch information...
1 parent 0ab39ff commit e25672667537b8307ac30e4b372eacbc1b5fb817 @mpapis mpapis committed Aug 5, 2012
Showing with 15 additions and 0 deletions.
  1. +5 −0 core/internal/shell/variables/functions
  2. +10 −0 core/internal/shell/variables/variables_comment_test.sh
@@ -74,3 +74,8 @@ __sm.variables.must.be.empty()
${_error} "Variables '${__sm_variables_nonempty[@]}' are suposed to be empty but are not."
fi
}
+
+__sm.variable.is.array()
+{
+ set | grep "^$1=(" >/dev/null
+}
@@ -0,0 +1,10 @@
+#!/usr/bin/env zsh
+
+eval $(./local test sm internal/variables )
+
+
+: variable is array
+typeset val_string
+__sm.variable.is.array "val_string" # status!=0
+typeset -a val_array
+__sm.variable.is.array "val_array" # status=0

0 comments on commit e256726

Please sign in to comment.