]>
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=() | |
5ddbbf02 ER |
10 | |
11 | case "${COMP_WORDS[1]}" in | |
12 | -@(e|-erase)) | |
13 | if [[ "$cur" == -* ]]; then | |
14 | COMPREPLY=( $( compgen -W '--nodeps --nofollow --test' -- $cur ) ) | |
15 | else | |
16 | _rpm_installed_packages | |
17 | fi | |
18 | return 0 | |
19 | ;; | |
20 | esac | |
21 | ||
22 | ||
20998f4e ER |
23 | cur=${COMP_WORDS[COMP_CWORD]} |
24 | prev=${COMP_WORDS[COMP_CWORD-1]} | |
20998f4e | 25 | |
a5640ce3 ER |
26 | case "$prev" in |
27 | -@(n|-sn)) | |
28 | COMPREPLY=( $( poldek -l | awk "/^$cur/{print \$1}" ) ) | |
29 | return 0 | |
30 | ;; | |
a5640ce3 | 31 | esac |
40c9869e | 32 | |
5ddbbf02 | 33 | case "$cur" in |
433751c0 ER |
34 | --verify*=*,*) |
35 | local p=${cur#--verify=*,} | |
36 | p=${p//\\} # those backslashes propagate!!! -- kill them | |
37 | # somewhy bash escapes equal sign, so we must match the backslash too | |
38 | COMPREPLY=( $( compgen -P "${p%,*}," -W 'deps conflicts file-conflicts file-orphans file-missing-deps' -- "${cur##*,}" ) ) | |
39 | return 0 | |
40 | ;; | |
41 | --verify*) | |
42 | # somewhy bash escapes equal sign, so we must match the backslash too | |
43 | COMPREPLY=( $( compgen -P --verify= -W 'deps conflicts file-conflicts file-orphans file-missing-deps' -- "${cur#--verify*=}" ) ) | |
44 | return 0 | |
45 | ;; | |
5ddbbf02 ER |
46 | --*) |
47 | COMPREPLY=( $( compgen -W ' | |
48 | --mkidx --makeidx --mt --nocompress --nodesc --nodiff --notimestamp | |
49 | --dn --dt --sn --prefix --source --st --clean --clean-pkg | |
50 | --clean-whole --cleana --sl --stl --update --up --update-whole | |
51 | --upa --caplookup --pset --downgrade --install --reinstall | |
52 | --upgrade --install-dist --reinstall-dist --root --upgrade-dist | |
53 | --dump --dumpn --fetch --follow --force --fresh --greedy --hold | |
54 | --ignore --justdb --mercy --nodeps --nohold --noignore --nofollow | |
55 | --parsable-tr-summary --pm-force --pm-nodeps --pmopt --promoteepoch | |
433751c0 | 56 | --uniq --test --erase --greedy --nodeps --nofollow --test --verify= |
5ddbbf02 ER |
57 | --priconf --split --split-out --ask --cachedir --cmd --conf --log |
58 | --noask --noconf --pmcmd --runas --shell --skip-installed --sudocmd | |
59 | --upconf --help --usage --version | |
60 | ' -- $cur ) ) | |
61 | ;; | |
62 | *) | |
63 | COMPREPLY=( $( compgen -W '-F -N -O -P -Q -V -e -i -l -m -n -q -r -s -t -u -v' \ | |
64 | -- $cur ) ) | |
20998f4e ER |
65 | ;; |
66 | esac | |
67 | ||
68 | return 0 | |
69 | } | |
433751c0 ER |
70 | complete -F _poldek $nospace $filenames poldek |
71 | ||
20998f4e | 72 | } |