-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path_dbus
48 lines (42 loc) · 859 Bytes
/
_dbus
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
42
43
44
45
46
47
48
#compdef dbus
local count="$#words"
local opts=0
for word in $words[2,-2] ; do
case $word in
-*)
(( opts += 1 ))
;;
*)
break
;;
esac
done
if (( opts == count - 2 )) ; then
if [[ $words[-1] = -* ]] ; then
_arguments -C \
{-a,--all}'[Equivalent to -e -s -t -u]' \
{-e,--empty}'[Also show empty services/objects]' \
{-h,--help}'[Print help]' \
{-s,--signals}'[Print signals]' \
{-t,--activatables}'[Also show activatables services]' \
{-u,--unnamed}'[Also show unnamed services]' \
{-y,--system-bus}'[Use system bus]'
return
fi
fi
case $((count - 2 - $opts)) in
0)
_message "service"
;;
1)
_message "object"
;;
2)
_message "method"
;;
*)
_wanted file expl "`dbus -c $words[2,-2]`" _files
return
esac
compadd `dbus -c $words[2,-2]`
return