From 67f7e53237c280f16b54ace4061486d3aefc30ba Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Fri, 11 Aug 2017 13:51:28 -0500 Subject: [PATCH] Ignore more invalid arguments from parsed man pages Specifically closes #4313. Not being as agressive in what we ignore/blacklist, but can be revisited easily in the future to add more characters to the argument blacklist. --- share/tools/create_manpage_completions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/tools/create_manpage_completions.py b/share/tools/create_manpage_completions.py index 0eb4045bc..598cff0a2 100755 --- a/share/tools/create_manpage_completions.py +++ b/share/tools/create_manpage_completions.py @@ -131,11 +131,12 @@ def built_command(options, description): fish_options = [] for optionstr in man_optionlist: option = re.sub(r"(\[.*\])", "", optionstr) - option = option.strip(" \t\n[]()") + option = option.strip(" \t\r\n[](){}.,:!") # Skip some problematic cases if option in ['-', '--']: continue + if any(c in "{}()" for c in option): continue if option.startswith('--'): # New style long option (--recursive)