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