fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Johannes AltmanningerMark private functions that don't need localizationa53db7256

master
898 B22 linesraw
1# localization: skip(private)
2function __fish_print_rpm_packages
3    type -q -f rpm /usr/share/yum-cli/completion-helper.py || return 1
4
5    # We do not use "--installed", but we still allow passing it.
6    argparse i/installed -- $argv
7    or return 1
8
9    if type -q -f /usr/share/yum-cli/completion-helper.py
10        # Remove package version information from output and pipe into cache file
11        __fish_cached -t 21600 -k yum-completion-helper -- '/usr/share/yum-cli/completion-helper.py list all -d 0 -C | sed "s/\\..*/\\tPackage/"'
12        return
13    end
14
15    # Rpm is too slow for this job, so we set it up to do completions
16    # as a background job and cache the results.
17    if type -q -f rpm
18        # Remove package version information from output and pipe into cache file
19        __fish_cached -t 250 -- "rpm -qa | sed -e 's/-[^-]*-[^-]*\$/\\t'Package'/'"
20        return
21    end
22end