Ignore comments when creating man page completion

This commit is contained in:
Mohamed Akram 2017-07-21 04:43:46 +04:00 committed by Kurtis Rader
parent f8fa69f817
commit d2d707a6fa

View file

@ -528,7 +528,6 @@ class TypeDarwinManParser(ManParser):
line = line.replace('.Nm', CMDNAME) line = line.replace('.Nm', CMDNAME)
line = line.replace('\\ ', ' ') line = line.replace('\\ ', ' ')
line = line.replace('\& ', '') line = line.replace('\& ', '')
line = line.replace(r'.\"', '')
return line return line
def is_option(self, line): def is_option(self, line):
@ -567,6 +566,9 @@ class TypeDarwinManParser(ManParser):
desc_lines = [] desc_lines = []
while lines and not self.is_option(lines[0]): while lines and not self.is_option(lines[0]):
line = lossy_unicode(lines.pop(0).strip()) line = lossy_unicode(lines.pop(0).strip())
# Ignore comments
if line.startswith(r'.\"'):
continue
if line.startswith('.'): if line.startswith('.'):
line = self.groff_replace_escapes(line) line = self.groff_replace_escapes(line)
line = self.trim_groff(line).strip() line = self.trim_groff(line).strip()