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