]> git.ipfire.org Git - thirdparty/systemd.git/blob - shell-completion/zsh/_systemd-resolve
pkgconfig: define variables relative to ${prefix}/${rootprefix}/${sysconfdir}
[thirdparty/systemd.git] / shell-completion / zsh / _systemd-resolve
1 #compdef systemd-resolve
2 # SPDX-License-Identifier: LGPL-2.1+
3
4 #
5 # This file is part of systemd.
6 #
7 # systemd is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU Lesser General Public License as published by
9 # the Free Software Foundation; either version 2.1 of the License, or
10 # (at your option) any later version.
11 #
12 # systemd is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public License
18 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
19
20 _dns_protocol() {
21 local -a _protocol
22 _protocol=( $(_call_program protocol ${service} --legend=no --protocol help; echo help) )
23 _values 'protocol' "$_protocol[@]"
24 }
25
26 _dns_type() {
27 local -a _type
28 _type=( $(_call_program type ${service} --legend=no --type help; echo help) )
29 _values 'type' "$_type[@]"
30 }
31
32 _dns_class() {
33 local -a _class
34 _class=( $(_call_program class ${service} --legend=no --class help; echo help) )
35 _values 'class' "$_class[@]"
36 }
37
38 _systemd-resolve_none() {
39 _alternative : \
40 'domain:DNS address:' \
41 'address:email address:'
42 }
43
44 _arguments \
45 {-h,--help}'[Print a short help text and exit]' \
46 '--version[Print a short version string and exit]' \
47 '--legend=no[Do not show headers and footers]' \
48 '-4[Resolve IPv4 addresses]' \
49 '-6[Resolve IPv6 addresses]' \
50 {-i+,--interface=}'[Look on interface]:interface:_net_interfaces' \
51 {-p+,--protocol=}'[Look via protocol]:protocol:_dns_protocol' \
52 {-t+,--type=}'[Query RR with DNS type]:type:_dns_type' \
53 {-c+,--class=}'[Query RR with DNS class]:class:_dns_class' \
54 '--service[Resolve services]' \
55 '--service-address=no[Do not resolve address for services]' \
56 '--service-txt=no[Do not resolve TXT records for services]' \
57 '--openpgp[Query OpenPGP public key]' \
58 '--tlsa[Query TLS public key]' \
59 '--cname=no[Do not follow CNAME redirects]' \
60 '--search=no[Do not use search domains]' \
61 '--statistics[Show resolver statistics]' \
62 '--reset-statistics[Reset resolver statistics]' \
63 '*::default: _systemd-resolve_none'