Permalink
Browse files

cleanup completion

  • Loading branch information...
1 parent faf339a commit 751ae64a3cdf08643a44cad0709e66c77db99991 @falconindy committed Apr 23, 2012
Showing with 3 additions and 8 deletions.
  1. +3 −8 bash_completion
View
11 bash_completion
@@ -17,16 +17,11 @@ _cower() {
if [[ $cur = -* ]]; then # options
COMPREPLY=($(compgen -W "$opts" -- $cur))
- elif [[ $prev = @(-*t|--target) ]]; then # directories (taken from _cd)
- compgen -f /non-existing-dir/ >/dev/null
+ elif [[ $prev = @(-*t|--target) ]]; then # directories
_filedir -d
- if (( ${#COMPREPLY[@]} == 1 )); then
- i=${COMPREPLY[0]}
- [[ $i = $cur && "$i" != */ ]] && COMPREPLY[0]="${i}/"
- fi
- elif [[ $prev = --ignore ]]; then
+ elif [[ $prev = --ignore ]]; then # installed packages
COMPREPLY=($(compgen -W "$(pacman -Qq)" -- $cur))
- elif [[ $prev = --ignorerepo ]]; then
+ elif [[ $prev = --ignorerepo ]]; then # available repos
COMPREPLY=($(compgen -W "$(sed '/^\[\(.*\)\]$/!d;s//\1/;/options/d' /etc/pacman.conf)" -- $cur))
elif [[ ${COMP_WORDS[@]:1:n-2} = *-@(!(-*)@(u)*|-update)* ]]; then # local packages
COMPREPLY=($(compgen -W "$(pacman -Qqm)" -- $cur))

0 comments on commit 751ae64

Please sign in to comment.