a step to remove __fish_sgrep per issue #2450

This commit is contained in:
Kurtis Rader 2017-04-15 21:49:08 -07:00
parent b3617cfd86
commit 75f1e36b44

View file

@ -4,7 +4,7 @@ function __fish_print_packages
# apt-cache is much, much faster than rpm, and can do this in real # apt-cache is much, much faster than rpm, and can do this in real
# time. We use it if available. # time. We use it if available.
switch (commandline -tc) switch (commandline -ct)
case '-**' case '-**'
return return
end end
@ -21,7 +21,7 @@ function __fish_print_packages
if type -q -f apt-cache if type -q -f apt-cache
# Do not generate the cache as apparently sometimes this is slow. # Do not generate the cache as apparently sometimes this is slow.
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=547550 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=547550
apt-cache --no-generate pkgnames (commandline -tc) ^/dev/null | sed -e 's/$/'\t$package'/' apt-cache --no-generate pkgnames (commandline -ct) ^/dev/null | sed -e 's/$/'\t$package'/'
return return
end end
@ -125,12 +125,12 @@ function __fish_print_packages
# eix is MUCH faster than emerge so use it if it is available # eix is MUCH faster than emerge so use it if it is available
if type -q -f eix if type -q -f eix
eix --only-names "^"(commandline -tc) | cut -d/ -f2 eix --only-names "^"(commandline -ct) | cut -d/ -f2
return return
else else
# FIXME? Seems to be broken # FIXME? Seems to be broken
if type -q -f emerge if type -q -f emerge
emerge -s \^(commandline -tc) | __fish_sgrep "^*" | cut -d\ -f3 | cut -d/ -f2 emerge -s \^(commandline -ct) | string match -r "^\*.*" | cut -d' ' -f3 | cut -d/ -f2
return return
end end
end end