From d895f876b46ebd280c0a166a7c4fe847385be547 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Sat, 9 Jul 2016 07:05:32 -0700 Subject: [PATCH] Fix "UNINDENT ..." junk in manpage completions Problem with Type2ManParser before: complete -c xcode-select -s h -l help --description 'Prints the usage message. UNINDENT NDENT 0. 0.' after: complete -c xcode-select -s h -l help --description 'Prints the usage message.' --- share/tools/create_manpage_completions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/share/tools/create_manpage_completions.py b/share/tools/create_manpage_completions.py index ab6c274cb..c58adae2d 100755 --- a/share/tools/create_manpage_completions.py +++ b/share/tools/create_manpage_completions.py @@ -363,7 +363,7 @@ class Type2ManParser(ManParser): options_section = options_section_matched.group(1) - options_parts_regex = re.compile("\.[I|T]P( \d+(\.\d)?i?)?(.*?)\.[I|T]P", re.DOTALL) + options_parts_regex = re.compile("\.[I|T]P( \d+(\.\d)?i?)?(.*?)\.([I|T]P|UNINDENT)", re.DOTALL) options_matched = re.search(options_parts_regex, options_section) add_diagnostic('Command is %r' % CMDNAME) @@ -774,7 +774,8 @@ def parse_manpage_at_path(manpage_path, output_directory): # Output the magic word Autogenerated so we can tell if we can overwrite this built_command_output.insert(1, "# Autogenerated from man page " + manpage_path) - built_command_output.insert(2, "# using " + parser.__class__.__name__) + # built_command_output.insert(2, "# using " + parser.__class__.__name__) # XXX MISATTRIBUTES THE CULPABILE PARSER! Was really using Type2 but reporting TypeDeroffManParser + for line in built_command_output: output_file.write(line) output_file.write('\n')