mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 09:39:52 +08:00
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:
parent
3f999209a5
commit
d09d2ca9ca
|
@ -131,11 +131,12 @@ def built_command(options, description):
|
||||||
fish_options = []
|
fish_options = []
|
||||||
for optionstr in man_optionlist:
|
for optionstr in man_optionlist:
|
||||||
option = re.sub(r"(\[.*\])", "", optionstr)
|
option = re.sub(r"(\[.*\])", "", optionstr)
|
||||||
option = option.strip(" \t\n[]()")
|
option = option.strip(" \t\r\n[](){}.,:!")
|
||||||
|
|
||||||
|
|
||||||
# Skip some problematic cases
|
# Skip some problematic cases
|
||||||
if option in ['-', '--']: continue
|
if option in ['-', '--']: continue
|
||||||
|
if any(c in "{}()" for c in option): continue
|
||||||
|
|
||||||
if option.startswith('--'):
|
if option.startswith('--'):
|
||||||
# New style long option (--recursive)
|
# New style long option (--recursive)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user