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.'
This commit is contained in:
Aaron Gyes 2016-07-09 07:05:32 -07:00
parent bb6ce9d142
commit d895f876b4

View file

@ -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')