aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_print_packages.fish
diff options
context:
space:
mode:
authorGravatar Kevin Ballard <kevin@sb.org>2014-07-10 00:26:58 -0700
committerGravatar Kevin Ballard <kevin@sb.org>2014-07-13 19:11:29 -0700
commit533496e43ac4de68537b66412d54e880e03b6561 (patch)
treeed6bf5c69595aa0385ce8307d542feaae91e8c1b /share/functions/__fish_print_packages.fish
parent6f7a7459c1dadc88e793b558d5ce2668359e7bea (diff)
Adopt the new type -q flag in the other functions
Diffstat (limited to 'share/functions/__fish_print_packages.fish')
-rw-r--r--share/functions/__fish_print_packages.fish14
1 files changed, 7 insertions, 7 deletions
diff --git a/share/functions/__fish_print_packages.fish b/share/functions/__fish_print_packages.fish
index 6755dd6a..050fcac2 100644
--- a/share/functions/__fish_print_packages.fish
+++ b/share/functions/__fish_print_packages.fish
@@ -18,7 +18,7 @@ function __fish_print_packages
end
mkdir -m 700 -p $XDG_CACHE_HOME
- if type -f apt-cache >/dev/null
+ if type -q -f apt-cache
# Do not generate the cache as apparently sometimes this is slow.
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=547550
apt-cache --no-generate pkgnames (commandline -tc) ^/dev/null | sed -e 's/$/'\t$package'/'
@@ -28,7 +28,7 @@ function __fish_print_packages
# Pkg is fast on FreeBSD and provides versioning info which we want for
# installed packages
if begin
- type -f pkg > /dev/null
+ type -q -f pkg
and test (uname) = "FreeBSD"
end
pkg query "%n-%v"
@@ -36,7 +36,7 @@ function __fish_print_packages
end
# Caches for 5 minutes
- if type -f pacman >/dev/null
+ if type -q -f pacman
set cache_file $XDG_CACHE_HOME/.pac-cache.$USER
if test -f $cache_file
cat $cache_file
@@ -53,7 +53,7 @@ function __fish_print_packages
end
# yum is slow, just like rpm, so go to the background
- if type -f /usr/share/yum-cli/completion-helper.py >/dev/null
+ if type -q -f /usr/share/yum-cli/completion-helper.py
# If the cache is less than six hours old, we do not recalculate it
@@ -75,7 +75,7 @@ function __fish_print_packages
# Rpm is too slow for this job, so we set it up to do completions
# as a background job and cache the results.
- if type -f rpm >/dev/null
+ if type -q -f rpm
# If the cache is less than five minutes old, we do not recalculate it
@@ -99,12 +99,12 @@ function __fish_print_packages
# installed on the system packages is in completions/emerge.fish
# eix is MUCH faster than emerge so use it if it is available
- if type -f eix > /dev/null
+ if type -q -f eix
eix --only-names "^"(commandline -tc) | cut -d/ -f2
return
else
# FIXME? Seems to be broken
- if type -f emerge >/dev/null
+ if type -q -f emerge
emerge -s \^(commandline -tc) |sgrep "^*" |cut -d\ -f3 |cut -d/ -f2
return
end