]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - tools/make-directive-index.py
make-directive-index: allow pages to specify the path to search
[thirdparty/systemd.git] / tools / make-directive-index.py
index 8703c8a37bd073f6938f706bb36f8f12b4261749..659c6275f5f5a274c643b4cc26a7cabb0da0c7f0 100755 (executable)
@@ -46,12 +46,22 @@ TEMPLATE = '''\
         <refsect1>
                 <title>Environment variables</title>
 
-                <para>Environment variables understood by the systemd
-                manager and other programs.</para>
+                <para>Environment variables understood by the systemd manager
+                and other programs and environment variable-compatible settings.</para>
 
                 <variablelist id='environment-variables' />
         </refsect1>
 
+        <refsect1>
+                <title>EFI variables</title>
+
+                <para>EFI variables understood by
+                <citerefentry><refentrytitle>systemd-boot</refentrytitle><manvolnum>7</manvolnum></citerefentry>
+                and other programs.</para>
+
+                <variablelist id='efi-variables' />
+        </refsect1>
+
         <refsect1>
                 <title>UDEV directives</title>
 
@@ -98,16 +108,25 @@ TEMPLATE = '''\
         </refsect1>
 
         <refsect1>
-                <title>System manager directives</title>
+                <title><citerefentry><refentrytitle>systemd.nspawn</refentrytitle><manvolnum>5</manvolnum></citerefentry>
+                directives</title>
+
+                <para>Directives for configuring systemd-nspawn containers.</para>
+
+                <variablelist id='nspawn-directives' />
+        </refsect1>
+
+        <refsect1>
+                <title>Program configuration options</title>
 
                 <para>Directives for configuring the behaviour of the
-                systemd process.</para>
+                systemd process and other tools through configuration files.</para>
 
-                <variablelist id='systemd-directives' />
+                <variablelist id='config-directives' />
         </refsect1>
 
         <refsect1>
-                <title>command line options</title>
+                <title>Command line options</title>
 
                 <para>Command-line options accepted by programs in the
                 systemd suite.</para>
@@ -161,17 +180,21 @@ 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):
                 text = re.sub(r'([= ]).*', r'\1', name.text).rstrip()
+                if text.startswith('-'):
+                    # for options, merge options with and without mandatory arg
+                    text = text.partition('=')[0]
                 stor[text].append((pagename, section))
                 if text not in formatting:
                     # use element as formatted display
-                    if name.text[-1] in '= ':
+                    if name.text[-1] in "= '":
                         name.clear()
                     else:
                         name.tail = ''
@@ -185,7 +208,7 @@ def _extract_directives(directive_groups, formatting, page):
         for name in t.iterfind(xpath):
             if absolute_only and not (name.text and name.text.startswith('/')):
                 continue
-            if name.attrib.get('noindex'):
+            if name.attrib.get('index') == 'false':
                 continue
             name.tail = ''
             if name.text:
@@ -209,7 +232,7 @@ def _extract_directives(directive_groups, formatting, page):
 
     storfile = directive_groups['constants']
     for name in t.iterfind('.//constant'):
-        if name.attrib.get('noindex'):
+        if name.attrib.get('index') == 'false':
             continue
         name.tail = ''
         if name.text.startswith('('): # a cast, strip it