mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-31 23:28:45 +00:00
__fish_complete_command: Fix --foo= logic
This was already supposed to handle `--foo=bar<TAB>` cases, except it
printed the `--foo=` again, causing fish to take that as part of the
token.
See #9538 for a similar thing with __fish_complete_directories.
Fixes #10011
(cherry picked from commit b03327f5d2
)
This commit is contained in:
parent
1119f68e66
commit
57bd21e7ce
2 changed files with 5 additions and 1 deletions
|
@ -3,7 +3,7 @@ function __fish_complete_command --description 'Complete using all available com
|
||||||
switch $ctoken
|
switch $ctoken
|
||||||
case '*=*'
|
case '*=*'
|
||||||
set ctoken (string split "=" -- $ctoken)
|
set ctoken (string split "=" -- $ctoken)
|
||||||
printf '%s\n' $ctoken[1]=(complete -C "$ctoken[2]")
|
complete -C "$ctoken[2]"
|
||||||
case '-*' # do not try to complete options as commands
|
case '-*' # do not try to complete options as commands
|
||||||
return
|
return
|
||||||
case '*'
|
case '*'
|
||||||
|
|
|
@ -532,3 +532,7 @@ begin
|
||||||
end
|
end
|
||||||
|
|
||||||
rm -r $tmpdir
|
rm -r $tmpdir
|
||||||
|
|
||||||
|
complete -C'complete --command=fish' | head -n 1 | string replace -rf '\t.*' ''
|
||||||
|
# (one "--command=" is okay, we used to get "--command=--command="
|
||||||
|
# CHECK: --command=fish
|
||||||
|
|
Loading…
Reference in a new issue