blob: 720700d04a32f8294e5ba7349087b5fa423aadf8 (
plain)
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
49
50
51
52
|
#compdef varlinkctl
# SPDX-License-Identifier: LGPL-2.1-or-later
local -a reply line
_varlinkctl_interfaces() {
local expl
_wanted varlink-interfaces expl interface compadd "$@" -- \
"${(@f)$(_call_program varlink-interfaces varlinkctl list-interfaces $line[2])}"
}
_varlinkctl_methods() {
local expl
_wanted varlink-interfaces expl method compadd "$@" -- \
"${(@f)$(_call_program varlink-methods varlinkctl list-methods $line[2])}"
}
local -a varlink_addr=(
/$'[^\0]#\0'/ ':varlink-address:varlink address:_files -g "*(=)"'
)
local -a varlink_interface=(
$varlink_addr
/$'[^\0]#\0'/ ':varlink-interface:varlink interface:_varlinkctl_interfaces'
)
local -a varlink_method=(
$varlink_addr
/$'[^\0]#\0'/ ':varlink-method:varlink method:_varlinkctl_methods'
)
local -a varlink_call=($varlink_method /$'[^\0]#\0'/ ':argument:argument:()')
local -a varlink_idl=(/$'[^\0]#\0'/ ':varlink-idl-file:idl file:_files')
_regex_words varlink-commands 'varlink command' \
'info:show service information:$varlink_addr' \
'list-interfaces:List interfaces implemented by a service:$varlink_addr' \
'list-methods:List methods implemented by an interface:$varlink_interface' \
'introspect:show an interface definition:$varlink_interface' \
'call:invoke a method:$varlink_call' \
'validate-idl:validate an interface description:$varlink_idl' \
'help:show a help message'
local -a varlinkcmd=( /$'[^\0]#\0'/ "$reply[@]" )
_regex_arguments _varlinkctl_command "$varlinkcmd[@]"
local -a opts=(
{-h,--help}'[Show a help message and exit]'
'--version[Show package version and exit]'
'--no-pager[Do not pipe output to a pager]'
'--more[Request multiple responses]'
'--collect[Collect multiple responses in a JSON array]'
{-j+,--json=}'[Output as json]:json-mode:(pretty short)'
)
_arguments -S $opts '*:: := _varlinkctl_command'
|