chiark / gitweb /
coredump: coredumpctl is so useful now, make it a first-class citizen
[elogind.git] / shell-completion / zsh / _busctl
1 #compdef busctl
2
3 # hostnamectl(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         "monitor:Show bus traffic"
28     )
29     if (( CURRENT == 1 )); then
30         _describe -t commands 'busctl command' _busctl_cmds || compadd "$@"
31     else
32         local curcontext="$curcontext"
33         cmd="${${_busctl_cmds[(r)$words[1]:*]%%:*}}"
34         if (( $+functions[_busctl_$cmd] )); then
35             _busctl_$cmd
36         else
37             _message "no more options"
38         fi
39     fi
40 }
41
42 _arguments \
43     {-h,--help}'[Prints a short help text and exits.]' \
44     '--version[Prints a short version string and exits.]' \
45     '--no-pager[Do not pipe output into a pager]' \
46     '--no-legend[Do not show the headers and footers]' \
47     '--system[Connect to system manager]' \
48     '--user[Connect to user service manager]' \
49     {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \
50     {-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \
51     '--address=[Connect to the bus specified by address]:address' \
52     '--show-machine[Show machine ID column in list]' \
53     '--unique[Only show unique names]' \
54     '--acquired[Only show acquired names]' \
55     '--activatable[Only show activatable names]' \
56     '--match=[Only show matching messages]:match' \
57     '*::busctl command:_busctl_command'