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.
This commit is contained in:
Mahmoud Al-Qudsi 2017-08-11 13:51:28 -05:00 committed by Kurtis Rader
parent 5ceac038b1
commit fa4cf77aff

View File

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