Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 41 lines (32 sloc) 1.447 kb
3be8515e »
2010-07-30 completion: rename to remove superfluous prefix
1 #!/bin/bash
2
3 _cower() {
68b6cfb9 »
2010-12-31 fix more bash_completion issues
4 local i cur prev opts ng
3be8515e »
2010-07-30 completion: rename to remove superfluous prefix
5
390e5039 »
2010-11-13 clean up completion file
6 _get_comp_words_by_ref cur prev
3be8515e »
2010-07-30 completion: rename to remove superfluous prefix
7
390e5039 »
2010-11-13 clean up completion file
8 # nullglob avoids problems when no results are found
9 [[ -o nullglob ]] || { shopt -s nullglob; ng=1; }
3be8515e »
2010-07-30 completion: rename to remove superfluous prefix
10
33053a88 »
2011-03-06 bash_completion: cleanup, add missing options
11 opts="-d --download -i --info -m --msearch -s --search -u --update
f636c8f6 »
2011-03-06 add --nossl option to avoid use of ssl connections
12 -c --color -f --force -h --help --ignore --ignorerepo --nossl
13 -q --quiet -t --target --threads -v --verbose --debug"
3be8515e »
2010-07-30 completion: rename to remove superfluous prefix
14
68b6cfb9 »
2010-12-31 fix more bash_completion issues
15 n=${#COMP_WORDS[@]}
16
5225bbfa »
2011-03-07 bash_completion: style cleanup
17 if [[ "$cur" = -* ]]; then # options
390e5039 »
2010-11-13 clean up completion file
18 COMPREPLY=($(compgen -W "$opts" -- $cur))
5225bbfa »
2011-03-07 bash_completion: style cleanup
19 elif [[ "$prev" = @(-*t|--target) ]]; then # directories (taken from _cd)
862b8b24 »
2010-12-29 fix bash_completion issues
20 compgen -f /non-existing-dir/ >/dev/null
21 _filedir -d
22 if (( ${#COMPREPLY[@]} == 1 )); then
23 i=${COMPREPLY[0]}
5225bbfa »
2011-03-07 bash_completion: style cleanup
24 [[ "$i" = $cur && "$i" != */ ]] && COMPREPLY[0]="${i}/"
862b8b24 »
2010-12-29 fix bash_completion issues
25 fi
54fd3d4e »
2011-03-07 bash_completion: add completion for --ignore
26 elif [[ "$prev" = --ignore ]]; then
27 COMPREPLY=($(compgen -W "$(pacman -Qq)" -- $cur))
5225bbfa »
2011-03-07 bash_completion: style cleanup
28 elif [[ "$prev" = --ignorerepo ]]; then
28f774ce »
2011-03-07 bash_completion: add completion for --ignorerepo
29 COMPREPLY=($(compgen -W "$(sed '/^\[\(.*\)\]$/!d;s//\1/;/options/d' /etc/pacman.conf)" -- $cur))
5225bbfa »
2011-03-07 bash_completion: style cleanup
30 elif [[ "${COMP_WORDS[@]:1:n-2}" = *-@(!(-*)@(u)*|-update)* ]]; then # local packages
8bd56b36 »
2010-12-21 fix bash_completion
31 COMPREPLY=($(compgen -W "$(pacman -Qqm)" -- $cur))
5225bbfa »
2011-03-07 bash_completion: style cleanup
32 elif [[ "${COMP_WORDS[@]:1:n-2}" = *-@(!(-*)@(d|i)*|-download|-info)* ]]; then # aur packages
68b6cfb9 »
2010-12-31 fix more bash_completion issues
33 COMPREPLY=($(compgen -W "$("${COMP_WORDS[0]}" -sq -- ^$cur 2>/dev/null)" -- $cur))
451d881e »
2010-08-03 bash_completion: complete package names anywhere as long as -d or -i …
34 fi
3be8515e »
2010-07-30 completion: rename to remove superfluous prefix
35
53b0fabb »
2010-08-04 bash_completion: bugfix. dont let completion returns without resettin…
36 # restore nullglob setting
3be8515e »
2010-07-30 completion: rename to remove superfluous prefix
37 [[ $ng ]] && shopt -u nullglob
38
39 }
40
862b8b24 »
2010-12-29 fix bash_completion issues
41 complete -F _cower -o nospace cower
Something went wrong with that request. Please try again.