diff --git a/bash.completion b/bash.completion index e69be6c4..d76ff019 100644 --- a/bash.completion +++ b/bash.completion @@ -4,7 +4,7 @@ # /usr/share/bash-completion/completions/pacaur # -_cower_pkg() { +_aur_pkg() { # at least 2 characters required due to AUR limitation COMPREPLY+=($(compgen -W "$(cower -sq -- ^$cur 2>/dev/null)" -- $cur)) } @@ -16,14 +16,16 @@ _pacaur() { cur=$(_get_cword) if ((COMP_CWORD == 1)); then if [[ $cur != -* ]]; then - _pacman_file; return 0; + _arch_compgen "${COMPREPLY[@]}" "sync search info downloadonly sysupgrade upgrades" + _pacman_file + return 0 else _pacman &> /dev/null - _arch_compgen "${COMPREPLY[@]}" "-s --search -i --info -m --makepkg -y --sync -u --update -k --check -v --version -h --help" + _arch_compgen "${COMPREPLY[@]}" "-v --version -h --help" return 0 fi fi - for o in 'D database' 'Q query' 'R remove' 'S sync' 'U upgrade' 'i info' 'm makepkg' 'y sync' 'u update' 'k check'; do + for o in 'D database' 'F files' 'Q query' 'R remove' 'S sync' 'T deptest' 'U upgrade' 'V version'; do _arch_incomp "$o" && break done (($?)) && op="" || op="${o% *}" @@ -34,9 +36,9 @@ _pacaur() { esac else case "$op" in - S) _pacman_pkg Slq; _cower_pkg;; # No fallback var support. - d|i|m|y) _cower_pkg;; - k|u) _pacman_pkg Qqm;; + S) _pacman_pkg Slq; _aur_pkg;; # No fallback var support. + info|downloadonly|sync) _aur_pkg;; + sysupgrade|upgrades) _pacman_pkg Qqm;; esac fi } diff --git a/zsh.completion b/zsh.completion index dac6ad34..cefb219d 100644 --- a/zsh.completion +++ b/zsh.completion @@ -46,12 +46,12 @@ _pacaur_opts_commands=( {-T,--deptest}'[Check if dependencies are installed]' {-U,--upgrade}'[Upgrade a package]' - {-s,--search}'[Search AUR package names and descriptions]' - {-i,--info}'[Show info for target(s)]' - {-m,--makepkg}'[Download and make target(s)]' - {-y,--sync}'[Download, make and install target(s)]' - {-k,--check}'[Check for AUR update(s)]' - {-u,--update}'[Update AUR package(s)]' + {sync}'[Download, make and install target(s)]' + {search}'[Search AUR package names and descriptions]' + {info}'[Show info for target(s)]' + {downloadonly}'[Download and make target(s)]' + {upgrades}'[Check for AUR update(s)]' + {sysupgrades}'[Update AUR package(s)]' {-h,--help}'[Display usage]' '-V[Display pacman version]' {-v,--version}'[Display pacaur version]' @@ -349,7 +349,7 @@ _pacaur_completions_all_packages() { _pacaur_completions_aur_packages() { zstyle -T ":completion:${curcontext}:" remote-access || return 1 local -a aur_packages - aur_packages=($(_call_program packages cower -sq -cnever $words[CURRENT] 2>/dev/null)) + aur_packages=($(_call_program packages cower -sq --color=never $words[CURRENT] 2>/dev/null)) _wanted aur_packages expl "aur packages" compadd - "${(@)aur_packages}" }