From d2d707a6faef50ad2b8cfe31ff49e33b6260944f Mon Sep 17 00:00:00 2001 From: Mohamed Akram Date: Fri, 21 Jul 2017 04:43:46 +0400 Subject: [PATCH] Ignore comments when creating man page completion --- share/tools/create_manpage_completions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/tools/create_manpage_completions.py b/share/tools/create_manpage_completions.py index fb63f8fab..0eb4045bc 100755 --- a/share/tools/create_manpage_completions.py +++ b/share/tools/create_manpage_completions.py @@ -528,7 +528,6 @@ class TypeDarwinManParser(ManParser): line = line.replace('.Nm', CMDNAME) line = line.replace('\\ ', ' ') line = line.replace('\& ', '') - line = line.replace(r'.\"', '') return line def is_option(self, line): @@ -567,6 +566,9 @@ class TypeDarwinManParser(ManParser): desc_lines = [] while lines and not self.is_option(lines[0]): line = lossy_unicode(lines.pop(0).strip()) + # Ignore comments + if line.startswith(r'.\"'): + continue if line.startswith('.'): line = self.groff_replace_escapes(line) line = self.trim_groff(line).strip()