diff options
Diffstat (limited to 'contrib/bash_completion')
-rw-r--r-- | contrib/bash_completion | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/contrib/bash_completion b/contrib/bash_completion index a27f4d75..d0851e70 100644 --- a/contrib/bash_completion +++ b/contrib/bash_completion @@ -7,18 +7,6 @@ # Distributed under the terms of the GNU General Public License, v2 or later. # -## ChangeLog ## -# -# * 3.0 (2007-02-18) -# - Updated to pacman 3.0.0 options -# * 1.1 (2004-01-17) -# - Code cleanup -# - Updated to pacman 2.7.2-2 -# * 2004-02-16 (orelien) -# - Improved available_{pkgs,groups) functions -# - Added support for querying groups -# - ## initial functions rem_selected () @@ -60,7 +48,7 @@ _available_pkgs () local available_pkgs local enabled_repos enabled_repos=$( grep '\[' /etc/pacman.conf | grep -v -e 'options' -e '^#' | tr -d '[]' ) - available_pkgs=$( for r in $enabled_repos; do echo /var/lib/pacman/$r/*; done ) + available_pkgs=$( for r in $enabled_repos; do echo /var/lib/pacman/sync/$r/*; done ) COMPREPLY=( $( compgen -W "$( for i in $available_pkgs; do j=${i##*/}; echo ${j%-*-*}; done )" -- $cur ) ) } @@ -79,7 +67,7 @@ _available_groups () local available_groups local enabled_repos enabled_repos=$( grep '\[' /etc/pacman.conf | grep -v -e 'options' -e '^#' | tr -d '[]' ) - available_groups=$( for r in $enabled_repos; do sed '/%GROUPS%/,/^$/{//d; p}' /var/lib/pacman/$r/*/desc | sort -u; done ) + available_groups=$( for r in $enabled_repos; do sed '/%GROUPS%/,/^$/{//d; p}' /var/lib/pacman/sync/$r/*/desc | sort -u; done ) COMPREPLY=( $( compgen -W "$( for i in $available_groups; do echo ${i%-*-*}; done )" -- $cur ) ) } @@ -105,8 +93,8 @@ _makepkg () if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '\ + -A --ignorearch \ -b --builddeps \ - -B --noccache \ -c --clean \ -C --cleancache \ -d --nodeps \ @@ -115,14 +103,14 @@ _makepkg () -g --geninteg \ -h --help \ -i --install \ - -j \ -L --log \ -m --nocolor \ -o --nobuild \ -p \ -r --rmdeps \ -s --syncdeps \ - -S --usesudo \ + --asroot \ + --source \ --noconfirm \ --noprogressbar' -- $cur ) ) fi @@ -158,7 +146,7 @@ _pacman () toparse="${a:2}" case "${arg}" in - -@(A|U|F|R|S|Q|h|V)) + -@(A|U|R|S|Q|h|V)) op="${arg/-}" mod="${mod}${a:2}" ;; @@ -168,7 +156,6 @@ _pacman () add) op="A" ;; remove) op="R" ;; upgrade) op="U" ;; - freshen) op="F" ;; query) op="Q" ;; sync) op="S" ;; help) op="h" ;; @@ -184,15 +171,19 @@ _pacman () print-uris) mod="${mod}p" ;; search) mod="${mod}s" ;; sysupgrade) mod="${mod}u" ;; + upgrades) mod="${mod}u" ;; downloadonly) mod="${mod}w" ;; refresh) mod="${mod}y" ;; - orphans) mod="${mod}e" ;; + changelog) mod="${mod}c" ;; + deps) mod="${mod}d" ;; + explicit) mod="${mod}e" ;; + orphans) mod="${mod}t" ;; foreign) mod="${mod}m" ;; owns) mod="${mod}o" ;; file) mod="${mod}p" ;; search) mod="${mod}s" ;; + upgrades) mod="${mod}u" ;; cascade) mod="${mod}c" ;; - nodeps) mod="${mod}d" ;; dbonly) mod="${mod}k" ;; nosave) mod="${mod}n" ;; recursive) mod="${mod}s" ;; @@ -212,7 +203,6 @@ _pacman () if [ $COMP_CWORD -eq 1 ] && [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '\ -A --add \ - -F --freshen \ -h --help \ -Q --query \ -R --remove \ @@ -226,14 +216,15 @@ _pacman () if [[ "$cur" == -* ]]; then case "${op}" in - A|U|F) + A|U) COMPREPLY=( $( compgen -W '\ + --asdeps \ -d --nodeps \ -f --force \ -h --help \ --config \ + --logfile \ --noconfirm \ - --ask \ --noprogressbar \ --noscriptlet \ -v --verbose \ @@ -247,14 +238,13 @@ _pacman () COMPREPLY=( $( compgen -W '\ -c --cascade \ -d --nodeps \ - -f --force \ -h --help \ -k --dbonly \ -n --nosave \ -s --recursive \ --config \ + --logfile \ --noconfirm \ - --ask \ --noprogressbar \ --noscriptlet \ -v --verbose \ @@ -266,6 +256,7 @@ _pacman () ;; S) COMPREPLY=( $( compgen -W '\ + --asdeps \ -c --clean \ -d --nodeps \ -e --dependsonly \ @@ -279,10 +270,12 @@ _pacman () -u --sysupgrade \ -w --downloadonly \ -y --refresh \ + --needed \ --ignore \ + --ignoregroup \ --config \ + --logfile \ --noconfirm \ - --ask \ --noprogressbar \ --noscriptlet \ -v --verbose \ @@ -295,7 +288,8 @@ _pacman () Q) COMPREPLY=( $( compgen -W '\ -c --changelog \ - -e --orphans \ + -d --deps \ + -e --explicit \ -g --groups \ -h --help \ -i --info \ @@ -304,9 +298,11 @@ _pacman () -o --owns \ -p --file \ -s --search \ + -t --orphans \ + -u --upgrades \ --config \ + --logfile \ --noconfirm \ - --ask \ --noprogressbar \ --noscriptlet \ -v --verbose \ @@ -338,6 +334,9 @@ _pacman () elif _instring $mod p; then COMPREPLY=( $( compgen -d -- "$cur" ) \ $( compgen -f -X '!*.pkg.tar.gz' -- "$cur" ) ) + elif _instring $mod u; then + COMPREPLY='' + return 0 else _installed_pkgs fi |