]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - tools/make-directive-index.py
Merge pull request #14105 from keszybz/man-directives-cleanup
[thirdparty/systemd.git] / tools / make-directive-index.py
index 9d9448703fb70bae0b70b31d9c8504235e74e39b..da10575f32bcffad9041dc9c9482d94798ebeeb8 100755 (executable)
@@ -187,10 +187,13 @@ def _extract_directives(directive_groups, formatting, page):
                              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 = ''
@@ -204,7 +207,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:
@@ -228,7 +231,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