]> git.ipfire.org Git - thirdparty/systemd.git/blob - shell-completion/zsh/_systemd-resolve
build-sys: use #if Y instead of #ifdef Y everywhere
[thirdparty/systemd.git] / shell-completion / zsh / _systemd-resolve
1 #compdef systemd-resolve
2
3 #
4 # This file is part of systemd.
5 #
6 # Copyright 2016 Zbigniew Jędrzejewski-Szmek
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 _dns_protocol() {
22 local -a _protocol
23 _protocol=( $(_call_program protocol ${service} --legend=no --protocol help; echo help) )
24 _values 'protocol' "$_protocol[@]"
25 }
26
27 _dns_type() {
28 local -a _type
29 _type=( $(_call_program type ${service} --legend=no --type help; echo help) )
30 _values 'type' "$_type[@]"
31 }
32
33 _dns_class() {
34 local -a _class
35 _class=( $(_call_program class ${service} --legend=no --class help; echo help) )
36 _values 'class' "$_class[@]"
37 }
38
39 _systemd-resolve_none() {
40 _alternative : \
41 'domain:DNS address:' \
42 'address:email address:'
43 }
44
45 _arguments \
46 {-h,--help}'[Print a short help text and exit]' \
47 '--version[Print a short version string and exit]' \
48 '--legend=no[Do not show headers and footers]' \
49 '-4[Resolve IPv4 addresses]' \
50 '-6[Resolve IPv6 addresses]' \
51 {-i+,--interface=}'[Look on interface]:interface:_net_interfaces' \
52 {-p+,--protocol=}'[Look via protocol]:protocol:_dns_protocol' \
53 {-t+,--type=}'[Query RR with DNS type]:type:_dns_type' \
54 {-c+,--class=}'[Query RR with DNS class]:class:_dns_class' \
55 '--service[Resolve services]' \
56 '--service-address=no[Do not resolve address for services]' \
57 '--service-txt=no[Do not resolve TXT records for services]' \
58 '--openpgp[Query OpenPGP public key]' \
59 '--tlsa[Query TLS public key]' \
60 '--cname=no[Do not follow CNAME redirects]' \
61 '--search=no[Do not use search domains]' \
62 '--statistics[Show resolver statistics]' \
63 '--reset-statistics[Reset resolver statistics]' \
64 '*::default: _systemd-resolve_none'