]> git.ipfire.org Git - thirdparty/systemd.git/blob - shell-completion/zsh/_resolvectl
Merge pull request #14423 from danielshahaf/zsh-add-missing-completions
[thirdparty/systemd.git] / shell-completion / zsh / _resolvectl
1 #compdef resolvectl systemd-resolve -*- shell-script -*-
2 # SPDX-License-Identifier: LGPL-2.1+
3 #
4 # This file is part of systemd.
5 #
6 # systemd is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU Lesser General Public License as published by
8 # the Free Software Foundation; either version 2.1 of the License, or
9 # (at your option) any later version.
10 #
11 # systemd is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public License
17 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
18
19 (( $+functions[_resolvectl_protocols] )) ||
20 _resolvectl_protocols() {
21 local -a _protocol
22 _protocol=( $(_call_program protocol ${service} --legend=no --protocol help; echo help) )
23 _values 'protocol' "$_protocol[@]"
24 }
25
26 (( $+functions[_resolvectl_types] )) ||
27 _resolvectl_types() {
28 local -a _type
29 _type=( $(_call_program type ${service} --legend=no --type help; echo help) )
30 _values 'type' "$_type[@]"
31 }
32
33 (( $+functions[_resolvectl_classes] )) ||
34 _resolvectl_classes() {
35 local -a _class
36 _class=( $(_call_program class ${service} --legend=no --class help; echo help) )
37 _values 'class' "$_class[@]"
38 }
39
40 (( $+functions[_resolvectl_commands] )) ||
41 _resolvectl_commands() {
42 local -a _resolvectl_cmds
43 _resolvectl_cmds=(
44 default-route:"Configure per-interface default-route setting"
45 dns:"Configure per-interface DNS configuration"
46 dnsovertls:"Configure per-interface dnsovertls enabled status"
47 dnssec:"Configure per-interface dnssec enabled status"
48 domain:"Configure per-interface search and route-only domains"
49 flush-caches:"Flushes all DNS resource record caches the service maintains locally"
50 llmnr:"Configure per-interface llmnr enabled status"
51 mdns:"Configure per-interface mdns enabled status"
52 nta:"Configure per-interface nta domains"
53 openpgp:"Retrieve openpgp keys for an email"
54 query:"Resolve domain names, IPv4 and IPv6 addresses"
55 reset-server-features:"Flushes all feature level information the resolver has learned about specific servers"
56 reset-statistics:"Resets the statistics counter show in statistics to zero"
57 revert:"Revert the per-interfce DNS configuration"
58 service:"Resolve DNS-SD and SRV services"
59 status:"Show the global and per-link DNS settings currently in effect"
60 tlsa:"Query tlsa public keys stored as TLSA resource records"
61 )
62
63 if (( CURRENT == 1 )); then
64 _describe -t commands 'resolvectl commands' _resolvectl_cmds
65 fi
66 }
67
68 _arguments \
69 {-h,--help}'[Print a short help text and exit]' \
70 '--version[Print a short version string and exit]' \
71 '--legend=no[Do not show headers and footers]' \
72 '-4[Resolve IPv4 addresses]' \
73 '-6[Resolve IPv6 addresses]' \
74 {-i+,--interface=}'[Look on interface]:interface:_net_interfaces' \
75 {-p+,--protocol=}'[Look via protocol]:protocol:_resolvectl_protocols' \
76 {-t+,--type=}'[Query RR with DNS type]:type:_resolvectl_types' \
77 {-c+,--class=}'[Query RR with DNS class]:class:_resolvectl_classes' \
78 '--service[Resolve services]' \
79 '--service-address=no[Do not resolve address for services]' \
80 '--service-txt=no[Do not resolve TXT records for services]' \
81 '--openpgp[Query OpenPGP public key]' \
82 '--tlsa[Query TLS public key]' \
83 '--cname=no[Do not follow CNAME redirects]' \
84 '--search=no[Do not use search domains]' \
85 '--statistics[Show resolver statistics]' \
86 '--reset-statistics[Reset resolver statistics]' \
87 '*::default: _resolvectl_commands'