]> git.ipfire.org Git - thirdparty/systemd.git/blame - shell-completion/zsh/_systemd-resolve
Merge pull request #11827 from keszybz/pkgconfig-variables
[thirdparty/systemd.git] / shell-completion / zsh / _systemd-resolve
CommitLineData
e81eb287 1#compdef systemd-resolve
7059062c 2# SPDX-License-Identifier: LGPL-2.1+
e81eb287
ZJS
3
4#
5# This file is part of systemd.
6#
e81eb287
ZJS
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
c501ecd7 20(( $+functions[_systemd-resolve_protocols] )) ||
21_systemd-resolve_protocols() {
e81eb287
ZJS
22 local -a _protocol
23 _protocol=( $(_call_program protocol ${service} --legend=no --protocol help; echo help) )
24 _values 'protocol' "$_protocol[@]"
25}
26
c501ecd7 27(( $+functions[_systemd-resolve_types] )) ||
28_systemd-resolve_types() {
e81eb287
ZJS
29 local -a _type
30 _type=( $(_call_program type ${service} --legend=no --type help; echo help) )
31 _values 'type' "$_type[@]"
32}
33
c501ecd7 34(( $+functions[_systemd-resolve_classes] )) ||
35_systemd-resolve_classes() {
e81eb287
ZJS
36 local -a _class
37 _class=( $(_call_program class ${service} --legend=no --class help; echo help) )
38 _values 'class' "$_class[@]"
39}
40
c501ecd7 41(( $+functions[_systemd-resolve_none] )) ||
e81eb287
ZJS
42_systemd-resolve_none() {
43 _alternative : \
44 'domain:DNS address:' \
45 'address:email address:'
46}
47
48_arguments \
49 {-h,--help}'[Print a short help text and exit]' \
50 '--version[Print a short version string and exit]' \
51 '--legend=no[Do not show headers and footers]' \
52 '-4[Resolve IPv4 addresses]' \
53 '-6[Resolve IPv6 addresses]' \
54 {-i+,--interface=}'[Look on interface]:interface:_net_interfaces' \
c501ecd7 55 {-p+,--protocol=}'[Look via protocol]:protocol:_systemd-resolve_protocols' \
56 {-t+,--type=}'[Query RR with DNS type]:type:_systemd-resolve_types' \
57 {-c+,--class=}'[Query RR with DNS class]:class:_systemd-resolve_classes' \
e81eb287
ZJS
58 '--service[Resolve services]' \
59 '--service-address=no[Do not resolve address for services]' \
60 '--service-txt=no[Do not resolve TXT records for services]' \
61 '--openpgp[Query OpenPGP public key]' \
62 '--tlsa[Query TLS public key]' \
63 '--cname=no[Do not follow CNAME redirects]' \
64 '--search=no[Do not use search domains]' \
65 '--statistics[Show resolver statistics]' \
66 '--reset-statistics[Reset resolver statistics]' \
67 '*::default: _systemd-resolve_none'