Skip to content
This repository has been archived by the owner on May 31, 2018. It is now read-only.

Commit

Permalink
adjusted completion files
Browse files Browse the repository at this point in the history
  • Loading branch information
rmarquis authored and ismaelgv committed Jul 28, 2017
1 parent 35a3832 commit f27abc1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
16 changes: 9 additions & 7 deletions bash.completion
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand All @@ -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% *}"
Expand All @@ -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
}
Expand Down
14 changes: 7 additions & 7 deletions zsh.completion
Original file line number Diff line number Diff line change
Expand Up @@ -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]'
Expand Down Expand Up @@ -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}"
}

Expand Down

0 comments on commit f27abc1

Please sign in to comment.