]>
Commit | Line | Data |
---|---|---|
20998f4e ER |
1 | have poldek && { |
2 | ||
3 | # poldek(1) completion | |
4 | # | |
5 | _poldek() | |
6 | { | |
7 | local cur prev ver nodig nosig | |
8 | ||
9 | COMPREPLY=() | |
10 | cur=${COMP_WORDS[COMP_CWORD]} | |
11 | prev=${COMP_WORDS[COMP_CWORD-1]} | |
12 | nodig="" | |
13 | nosig="" | |
14 | ||
15 | if [ $COMP_CWORD -eq 1 ]; then | |
16 | # first parameter on line | |
17 | case "$cur" in | |
18 | --*) | |
19 | COMPREPLY=( $( compgen -W '--help --version --erase \ | |
20 | ' -- $cur ) ) | |
21 | ;; | |
22 | *) | |
23 | COMPREPLY=( $( compgen -W '-F -N -O -P -Q -V -e -i -l -m -n -q -r -s -t -u -v' \ | |
24 | -- $cur ) ) | |
25 | ;; | |
26 | esac | |
27 | ||
28 | return 0 | |
29 | fi | |
30 | ||
31 | case "${COMP_WORDS[1]}" in | |
32 | -@(e|-erase)) | |
33 | if [[ "$cur" == -* ]]; then | |
34 | COMPREPLY=( $( compgen -W '--nodeps --nofollow --test' -- $cur ) ) | |
35 | else | |
36 | _rpm_installed_packages | |
37 | fi | |
38 | ;; | |
39 | esac | |
40 | ||
41 | return 0 | |
42 | } | |
43 | complete -F _poldek $filenames poldek | |
44 | } |