Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lede-mikrotik
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johannes Rudolph
lede-mikrotik
Commits
b20b8d15
Commit
b20b8d15
authored
17 years ago
by
Felix Fietkau
Browse files
Options
Downloads
Patches
Plain Diff
document config_foreach, close #2162
SVN-Revision: 8342
parent
014b05ae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/config.tex
+19
-0
19 additions, 0 deletions
docs/config.tex
with
19 additions
and
0 deletions
docs/config.tex
+
19
−
0
View file @
b20b8d15
...
...
@@ -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.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment