diff options
author | Jérémy Rosen <jeremy.rosen@smile.fr> | 2020-04-14 20:15:19 +0200 |
---|---|---|
committer | Jérémy Rosen <jeremy.rosen@smile.fr> | 2020-04-20 18:49:58 +0200 |
commit | acbfdec33e982c01cc2f2cc2cd6bed43665570e7 (patch) | |
tree | 3cb0bc1ac8400817ce10da83cd9f71b255cd1b77 /tools | |
parent | d512670a1f116746890d32806c3acd6176e61631 (diff) | |
download | systemd-acbfdec33e982c01cc2f2cc2cd6bed43665570e7.tar.gz |
make-directive-index: allow pages to specify the path to search
So far, make-directive-index would look for
./valistentry/term/varname for elements to add to the directive man page.
This commit allows to specify xpath= in the varlist directive to tell
the generator what to look for.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/make-directive-index.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/make-directive-index.py b/tools/make-directive-index.py index da10575f32..659c6275f5 100755 --- a/tools/make-directive-index.py +++ b/tools/make-directive-index.py @@ -180,9 +180,10 @@ def _extract_directives(directive_groups, formatting, page): storopt = directive_groups['options'] for variablelist in t.iterfind('.//variablelist'): klass = variablelist.attrib.get('class') + searchpath = variablelist.attrib.get('xpath','./varlistentry/term/varname') storvar = directive_groups[klass or 'miscellaneous'] # <option>s go in OPTIONS, unless class is specified - for xpath, stor in (('./varlistentry/term/varname', storvar), + for xpath, stor in ((searchpath, storvar), ('./varlistentry/term/option', storvar if klass else storopt)): for name in variablelist.iterfind(xpath): |