]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
make-directive-index: allow pages to specify the path to search
authorJérémy Rosen <jeremy.rosen@smile.fr>
Tue, 14 Apr 2020 18:15:19 +0000 (20:15 +0200)
committerJérémy Rosen <jeremy.rosen@smile.fr>
Mon, 20 Apr 2020 16:49:58 +0000 (18:49 +0200)
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.

tools/make-directive-index.py

index da10575f32bcffad9041dc9c9482d94798ebeeb8..659c6275f5f5a274c643b4cc26a7cabb0da0c7f0 100755 (executable)
@@ -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):