mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Strip out brackets from generated-by-manpage completions.
Handles cases like cupsctl --\[no-\]remote-admin and unxz --powerpc[ better. Fixes #3272
This commit is contained in:
parent
6c8ecab44b
commit
e75fc8452f
1 changed files with 4 additions and 2 deletions
|
@ -129,8 +129,10 @@ def built_command(options, description):
|
||||||
# print "Options are: ", options
|
# print "Options are: ", options
|
||||||
man_optionlist = re.split(" |,|\"|=|[|]", options)
|
man_optionlist = re.split(" |,|\"|=|[|]", options)
|
||||||
fish_options = []
|
fish_options = []
|
||||||
for option in man_optionlist:
|
for optionstr in man_optionlist:
|
||||||
option = option.strip()
|
option = re.sub(r"(\[.*\])", "", optionstr)
|
||||||
|
option = option.strip(" \t\n[]()")
|
||||||
|
|
||||||
|
|
||||||
# Skip some problematic cases
|
# Skip some problematic cases
|
||||||
if option in ['-', '--']: continue
|
if option in ['-', '--']: continue
|
||||||
|
|
Loading…
Reference in a new issue