about summary refs log tree commit diff
path: root/Completion/Debian/Command/_update-alternatives
blob: 1bf195828126dc8b5cbc726f033a984fb68c68ac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#compdef update-alternatives

local curcontext="$curcontext" context state line expl ret
typeset -A opt_args

_arguments -C '--verbose' \
           '--quiet' \
           '--test' \
           '--help' \
           '--version' \
           '--altdir:altdir:_files -/' \
           '--admindir:admindir:_files -/' \
    '--install:*::alt:= ->install' \
    '--remove:*::alt:= ->remove' \
    '--auto:name:_files -W /var/lib/dpkg/alternatives' \
    '--display:name:_files -W /var/lib/dpkg/alternatives' \
    '--config:name:_files -W /var/lib/dpkg/alternatives' && return 0

_call_function ret _update_alternatives_$state && return ret
case "$state" in
	islave)
	_arguments -C '1:link:_files' \
                   '2:name:_files -W /var/lib/dpkg/alternatives' \
                   '3:path:_files' \
                   '--slave:*::slave:->islave'
	;;
	install)
	_arguments -C '1:link:_files' \
                   '2:name:_files -W /var/lib/dpkg/alternatives' \
                   '3:path:_files' \
                   '4:priority:' \
                   '--slave:*::slave:->islave' \
	;;

	remove)
	_arguments \
                   '1:name:_files -W /var/lib/dpkg/alternatives' \
                   '2:path:_files'
	;;

esac