1
# Debian apt-fast(8) completion.
2
# Copy of Ubuntu 10.04 _apt_get function from apt completion. Merged with 12.04
3
# changes but preserve compatibility. _apt_get function renamed to _apt_fast.
8
local cur prev special i
12
prev=${COMP_WORDS[COMP_CWORD-1]}
14
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
15
if [[ ${COMP_WORDS[i]} == @(install|remove|autoremove|purge|source|build-dep|changelog|download) ]]; then
16
special=${COMP_WORDS[i]}
20
if [ -n "$special" ]; then
22
remove|autoremove|purge)
23
if [ -f /etc/debian_version ]; then
25
COMPREPLY=( $( _xfunc dpkg _comp_dpkg_installed_packages "$cur" ) )
28
_rpm_installed_packages
33
COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \
34
2> /dev/null ) $( apt-cache dumpavail | \
35
command grep "^Source: $cur" | sort -u | cut -f2 -d" " ) )
39
COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \
51
-@(t|-target-release|-default-release))
52
COMPREPLY=( $( apt-cache policy | \
53
command grep "release.o=Debian,a=$cur" | \
54
sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null) )
59
if [[ "$cur" == -* ]]; then
60
COMPREPLY=( $( compgen -W '-d -f -h -v -m -q -s -y -u -t -b -c -o
61
--download-only --fix-broken --help --version --ignore-missing
62
--fix-missing --no-download --quiet --simulate --just-print
63
--dry-run --recon --no-act --yes --assume-yes --show-upgraded
64
--only-source --compile --build --ignore-hold --target-release
65
--no-upgrade --force-yes --print-uris --purge --reinstall
66
--list-cleanup --default-release --trivial-only --no-remove
67
--diff-only --no-install-recommends --tar-only --config-file
68
--option --auto-remove' -- "$cur" ) )
70
COMPREPLY=( $( compgen -W 'update upgrade dselect-upgrade
71
dist-upgrade install remove purge source build-dep
72
check download clean autoclean autoremove changelog' -- "$cur" ) )
77
complete -F _apt_fast "$filenames" apt-fast
82
# sh-indent-comment: t
83
# indent-tabs-mode: nil
85
# ex: ts=4 sw=4 et filetype=sh