X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/d9219238b05cc37112dd11427581e1aa6b502b33..b1db5421deab84ff6cd6f7c2ac4b660129aa3880:/docs/config.tex

diff --git a/docs/config.tex b/docs/config.tex
index f3802198e..17417c99a 100644
--- a/docs/config.tex
+++ b/docs/config.tex
@@ -57,12 +57,28 @@ 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:
 
 \begin{Verbatim}
-config_get <section> <option>            # prints the value of the option
-config_get <variable> <section> <option> # stores the value inside the variable
+# print the value of the option
+config_get <section> <option>
+
+# store the value inside the variable
+config_get <variable> <section> <option>
 \end{Verbatim}
 
 In busybox ash the three-option \texttt{config\_get} is faster, because it does not
@@ -77,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.
+
