mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 12:23:09 +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
|
||||
man_optionlist = re.split(" |,|\"|=|[|]", options)
|
||||
fish_options = []
|
||||
for option in man_optionlist:
|
||||
option = option.strip()
|
||||
for optionstr in man_optionlist:
|
||||
option = re.sub(r"(\[.*\])", "", optionstr)
|
||||
option = option.strip(" \t\n[]()")
|
||||
|
||||
|
||||
# Skip some problematic cases
|
||||
if option in ['-', '--']: continue
|
||||
|
|
Loading…
Reference in a new issue