mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-15 09:27:38 +00:00
d282bc4625
Rework for Doxygen >1.8. Moved large parts of the documentation to a simplified format, making use of Markdown enhancements and fixing bad long options.
29 lines
710 B
Text
29 lines
710 B
Text
\section contains contains - test if a word is present in a list
|
|
|
|
\subsection contains-synopsis Synopsis
|
|
\fish{syn}
|
|
contains [OPTIONS] KEY [VALUES...]
|
|
\endfish
|
|
|
|
\subsection contains-description Description
|
|
|
|
`contains` tests whether the set `VALUES` contains the string
|
|
`KEY`. If so, `contains` exits with status 0; if not, it exits
|
|
with status 1.
|
|
|
|
The following options are available:
|
|
|
|
- `-i` or `--index` print the word index
|
|
- `-h` or `--help` display this message
|
|
|
|
\subsection contains-example Example
|
|
|
|
\fish
|
|
for i in ~/bin /usr/local/bin
|
|
if not contains $i $PATH
|
|
set PATH $PATH $i
|
|
end
|
|
end
|
|
\endfish
|
|
|
|
The above code tests if `~/bin` and `/usr/local/bin` are in the path and adds them if not.
|