diff options
author | Felix Fietkau <nbd@openwrt.org> | 2007-08-04 12:23:46 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2007-08-04 12:23:46 +0000 |
commit | b20b8d15237a8b8caffab003f33cfe8872b50c24 (patch) | |
tree | f78518c93e73e2a7afd1f6c6ca1ee9817efe0169 /docs/config.tex | |
parent | 014b05aea0dafeee16d23444f3a7cb9889f21836 (diff) | |
download | master-31e0f0ae-b20b8d15237a8b8caffab003f33cfe8872b50c24.tar.gz master-31e0f0ae-b20b8d15237a8b8caffab003f33cfe8872b50c24.tar.bz2 master-31e0f0ae-b20b8d15237a8b8caffab003f33cfe8872b50c24.zip |
document config_foreach, close #2162
SVN-Revision: 8342
Diffstat (limited to 'docs/config.tex')
-rw-r--r-- | docs/config.tex | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/config.tex b/docs/config.tex index d13297c4f7..17417c99a1 100644 --- a/docs/config.tex +++ b/docs/config.tex @@ -57,6 +57,19 @@ after \texttt{config\_load} is done. That allows you to process sections both before and after all options were processed. +Another way of iterating on config sections is using the \texttt{config\_foreach} command. + +Syntax: +\begin{Verbatim} +config_foreach <function name> [<sectiontype>] [<arguments...>] +\end{Verbatim} + +This command will run the supplied function for every single config section in the currently +loaded config. The section name will be passed to the function as argument 1. +If the section type is added to the command line, the function will only be called for +sections of the given type. + + You can access already processed options with the \texttt{config\_get} command Syntax: @@ -80,3 +93,9 @@ Syntax: config_set <section> <option> <value> \end{Verbatim} +If a config section is unnamed, an automatically generated name will +be assigned internally, e.g. \texttt{cfg1}, \texttt{cfg2}, ... + +While it is possible, using unnamed sections through these autogenerated names is +strongly discouraged. Use callbacks or \texttt{config\_foreach} instead. + |