summaryrefslogtreecommitdiff
path: root/tools/make-directive-index.py
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-11-21 22:02:07 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-11-21 22:06:30 +0100
commit8c6c56c36fa0749a0af9bb6c9075ca01e5154ac6 (patch)
tree03c5f1f474eec10bc9e4facfc1b8d89b2d5110cb /tools/make-directive-index.py
parentf8b68539d0ddda5964d533c2eb9c0d8bff95616b (diff)
downloadsystemd-8c6c56c36fa0749a0af9bb6c9075ca01e5154ac6.tar.gz
man: sort options without "=" in the directives index
Some options would appear twice in the index, e.g. --collect= and --collect. Some man pages use one form, some the other, and the argument might be mandatory for some commands but not others. Anyway, let's display them as one entry, to reduce the total number of items listed.
Diffstat (limited to 'tools/make-directive-index.py')
-rwxr-xr-xtools/make-directive-index.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/make-directive-index.py b/tools/make-directive-index.py
index 5b965f4163..da10575f32 100755
--- a/tools/make-directive-index.py
+++ b/tools/make-directive-index.py
@@ -187,6 +187,9 @@ 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