aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src/contains.txt
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-01-27 03:34:37 +1000
committerGravatar axel <axel@liljencrantz.se>2006-01-27 03:34:37 +1000
commite01ccb14af1f40c9e6d1cd06121c752c163e5745 (patch)
treeda2f6b9ff4ddc2c89c382d2f3c7673f9611eb8c3 /doc_src/contains.txt
parent86b7ae6d214fe9a256793d452f9d9e2b3ff13be2 (diff)
shellscript functions should use the help command to display help
darcs-hash:20060126173437-ac50b-69c03761554180467f741a9597205fab6c823378.gz
Diffstat (limited to 'doc_src/contains.txt')
-rw-r--r--doc_src/contains.txt24
1 files changed, 24 insertions, 0 deletions
diff --git a/doc_src/contains.txt b/doc_src/contains.txt
new file mode 100644
index 00000000..735562d1
--- /dev/null
+++ b/doc_src/contains.txt
@@ -0,0 +1,24 @@
+
+\section contains contains - Test if a word is present in a list
+
+\subsection contains-synopsis Synopsis
+<code>contains [OPTIONS] KEY [VALUES...]</code>
+
+\subsection contains-description Description
+
+- \c -h or \c --help display this message
+
+Test if the set VALUES contains the string KEY. Return status is 0 if
+yes, 1 otherwise
+
+
+\subsection contains-example Example
+<pre>
+for i in ~/bin /usr/local/bin
+ if not contains \$i \$PATH
+ set PATH \$PATH i
+ end
+end
+</pre>
+
+The above code tests if ~/bin and /usr/local/bin are in the path and if they are not, they are added.