summaryrefslogtreecommitdiff
path: root/README.markdown
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-10-02 15:06:47 +0200
committerGuido Günther <agx@sigxcpu.org>2014-10-02 18:47:26 +0200
commitb71d5617db54c55afa89cba1f003d30fa88af2a9 (patch)
tree297b948ee9b480b57eb055d5df894965b0ea32bf /README.markdown
parent165d5daf93f394c8eff20f77f699f782000596e5 (diff)
Add validate_nonemptyarray_msg
this makes is consistent with other validate_nonempty* functions
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown16
1 files changed, 16 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown
index a89a7fe..03a7284 100644
--- a/README.markdown
+++ b/README.markdown
@@ -70,3 +70,19 @@ The following values will fail, causing compilation to abort:
validate_nonemptyarray('some_string')
$undefined = undef
validate_nonemptyarray($undefined)
+
+validate_nonemptyarray_msg
+--------------------------
+Validate that the passed value is an array data structure. Abort catalog
+compilation if any value fails this check. Also abort if any of the arrays
+is empty. On failure it prints the message given as the second argument.
+
+The following values will pass:
+
+ $my_array = [ 'one', 'two' ]
+ validate_nonemptyarray_msg($my_array, 'foo')
+
+The following values will fail, causing compilation to abort with the given msg:
+
+ validate_nonemptyarray_msg(true, 'Not a nonempty array')
+ validate_nonemptyarray_msg([], 'Not a nonempty array')