]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tools: (asciidoctor-unicodeconverter) properly handle dotted commands
authorThomas Weißschuh <thomas@t-8ch.de>
Wed, 10 May 2023 10:21:24 +0000 (12:21 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Wed, 10 May 2023 10:30:05 +0000 (12:30 +0200)
Split from the end of the docname, as otherwise commands like "fsck.foo"
are stripped of their suffix.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
tools/asciidoctor-unicodeconverter.rb

index 7435ed5ffae572e5f785ee833925989da8a0a103..2c6fd43ffe3a185136b8d30feaec19b592c003e7 100644 (file)
@@ -12,7 +12,7 @@ module UnicodeConverter
     def process document, reader
       lines = reader.read_lines
       state = BEFORE_NAME_SECTION
-      command = document.attributes['docname'].split('.', 2)[0]
+      command = document.attributes['docname'].rpartition('.')[0]
       lines.map! do |line|
         if state == IN_NAME_SECTION
           line.sub! " \u2013 ", " - "