]> git.ipfire.org Git - thirdparty/systemd.git/blob - shell-completion/zsh/_busctl
a425b8c700531137615beb62f9f1f020c094314f
[thirdparty/systemd.git] / shell-completion / zsh / _busctl
1 #compdef busctl
2
3 # busctl(1) completion -*- shell-script -*-
4 #
5 # This file is part of systemd.
6 #
7 # Copyright 2013 Zbigniew Jędrzejewski-Szmek
8 #
9 # systemd is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU Lesser General Public License as published by
11 # the Free Software Foundation; either version 2.1 of the License, or
12 # (at your option) any later version.
13 #
14 # systemd is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details.
18 #
19 # You should have received a copy of the GNU Lesser General Public License
20 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
21
22 (( $+functions[_busctl_command] )) || _busctl_command()
23 {
24 local -a _busctl_cmds
25 _busctl_cmds=(
26 "list:List bus names"
27 "status:Show bus service, process or bus owner credentials"
28 "monitor:Show bus traffic"
29 "capture:Capture bus traffix as pcap"
30 "tree:Show object tree of service"
31 "introspect:Introspect object"
32 "call:Call a method"
33 "get-property:Get property value"
34 "set-property:Set property value"
35 )
36 if (( CURRENT == 1 )); then
37 _describe -t commands 'busctl command' _busctl_cmds || compadd "$@"
38 else
39 local curcontext="$curcontext"
40 cmd="${${_busctl_cmds[(r)$words[1]:*]%%:*}}"
41 if (( $+functions[_busctl_$cmd] )); then
42 _busctl_$cmd
43 else
44 _message "no more options"
45 fi
46 fi
47 }
48
49 _arguments \
50 {-h,--help}'[Prints a short help text and exits.]' \
51 '--version[Prints a short version string and exits.]' \
52 '--no-pager[Do not pipe output into a pager]' \
53 '--no-legend[Do not show the headers and footers]' \
54 '--system[Connect to system manager]' \
55 '--user[Connect to user service manager]' \
56 {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \
57 {-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \
58 '--address=[Connect to the bus specified by address]:address' \
59 '--show-machine[Show machine ID column in list]' \
60 '--unique[Only show unique names]' \
61 '--acquired[Only show acquired names]' \
62 '--activatable[Only show activatable names]' \
63 '--match=[Only show matching messages]:match' \
64 '--list[Do not show tree, but simple object path list]' \
65 '--quiet[Do not show method call reply]'\
66 '--verbose[Show result values in long format]' \
67 '--expect-reply=[Expect a method call reply]:boolean:(1 0)' \
68 '--auto-start=[Auto-start destination service]:boolean:(1 0)' \
69 '--allow-interactive-authorization=[Allow interactive authorization for operation]:boolean:(1 0)' \
70 '--timeout=[Maximum time to wait for method call completion]:timeout (seconds)' \
71 '--augment-creds=[Extend credential data with data read from /proc/$PID]:boolean:(1 0)' \
72 '*::busctl command:_busctl_command'