__fish_print_packages: whitespace fix

This commit is contained in:
David Adam 2013-09-17 22:20:16 +08:00
parent 95d5e55df2
commit 8df81f93c8

View file

@ -2,7 +2,7 @@
function __fish_print_packages 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 -tc)
case '-**' case '-**'
@ -22,18 +22,18 @@ function __fish_print_packages
return return
end end
# Pkg is fast on FreeBSD and provides versioning info which we want for # Pkg is fast on FreeBSD and provides versioning info which we want for
# installed packages # installed packages
if begin if begin
type -f pkg > /dev/null type -f pkg > /dev/null
and test (uname) = "FreeBSD" and test (uname) = "FreeBSD"
end end
pkg query "%n-%v" pkg query "%n-%v"
return return
end end
# yum is slow, just like rpm, so go to the background # 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 -f /usr/share/yum-cli/completion-helper.py >/dev/null
# If the cache is less than six hours old, we do not recalculate it # If the cache is less than six hours old, we do not recalculate it
@ -49,11 +49,11 @@ function __fish_print_packages
end end
# Remove package version information from output and pipe into cache file # Remove package version information from output and pipe into cache file
/usr/share/yum-cli/completion-helper.py list all -d 0 -C >$cache_file | cut -d '.' -f 1 | sed '1d' | sed '/^\s/d' | sed -e 's/$/'\t$package'/' & /usr/share/yum-cli/completion-helper.py list all -d 0 -C >$cache_file | cut -d '.' -f 1 | sed '1d' | sed '/^\s/d' | sed -e 's/$/'\t$package'/' &
end end
# Rpm is too slow for this job, so we set it up to do completions # Rpm is too slow for this job, so we set it up to do completions
# as a background job and cache the results. # as a background job and cache the results.
if type -f rpm >/dev/null if type -f rpm >/dev/null