mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 03:01:15 -03:00
__fish_print_packages: Extract the rest
Of note: The rpm/yum thing seems to be coupled, so I put it into one function that tries the yum helper and uses the rpm path otherwise. Zypper is already its own thing, so this should only be used for yum and probably dnf (does that still have the helper?) Zypper can be dropped, as that already used a separate function in the file. Apk can just be inlined - it's literally one line for installed and another for all packages.
This commit is contained in:
@@ -2,18 +2,13 @@ function __fish_print_apt_packages
|
||||
argparse --name=__fish_print_packages i/installed -- $argv
|
||||
or return
|
||||
|
||||
set -l only_installed 1
|
||||
if not set -q _flag_installed
|
||||
set -e only_installed
|
||||
end
|
||||
|
||||
switch (commandline -ct)
|
||||
case '-**'
|
||||
return
|
||||
end
|
||||
|
||||
type -q -f apt-cache || return 1
|
||||
if not set -q only_installed
|
||||
if not set -q _flag_installed
|
||||
# Do not generate the cache as apparently sometimes this is slow.
|
||||
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=547550
|
||||
# (It is safe to use `sed -r` here as we are guaranteed to be on a GNU platform
|
||||
|
||||
Reference in New Issue
Block a user