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