Debian Codegraph @

shell-completion/zsh/_resolvectl

raw
1 #compdef resolvectl systemd-resolve
2 # SPDX-License-Identifier: LGPL-2.1-or-later
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 <https://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 2>/dev/null; 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 2>/dev/null; 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 2>/dev/null; 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 log-level:"Get/set logging threshold for systemd-resolved"
52 mdns:"Configure per-interface mdns enabled status"
53 monitor:"Monitor DNS queries"
54 nta:"Configure per-interface nta domains"
55 openpgp:"Retrieve openpgp keys for an email"
56 query:"Resolve domain names, IPv4 and IPv6 addresses"
57 reset-server-features:"Flushes all feature level information the resolver has learned about specific servers"
58 reset-statistics:"Resets the statistics counter shown in statistics to zero"
59 revert:"Revert the per-interface DNS configuration"
60 service:"Resolve DNS-SD and SRV services"
61 show-cache:"Show the current cache contents"
62 show-server-state:"Show servers state"
63 statistics:"Show resolver statistics"
64 status:"Show the global and per-link DNS settings currently in effect"
65 tlsa:"Query tlsa public keys stored as TLSA resource records"
66 )
67
68 if (( CURRENT == 1 )); then
69 _describe -t commands 'resolvectl commands' _resolvectl_cmds
70 fi
71 }
72
73 _arguments \
74 '(- *)'{-h,--help}'[Print a short help text and exit]' \
75 '(- *)--version[Print a short version string and exit]' \
76 '--legend=[Do not show headers and footers]:BOOL:(yes no)' \
77 '-4[Resolve IPv4 addresses]' \
78 '-6[Resolve IPv6 addresses]' \
79 '(-i --interface)'{-i+,--interface=}'[Look on interface]:interface:_net_interfaces' \
80 '(-p --protocol)'{-p+,--protocol=}'[Look via protocol]:protocol:_resolvectl_protocols' \
81 '(-t --type)'{-t+,--type=}'[Query RR with DNS type]:type:_resolvectl_types' \
82 '(-c --class)'{-c+,--class=}'[Query RR with DNS class]:class:_resolvectl_classes' \
83 '--service[Resolve services]' \
84 '--service-address=[Do not resolve address for services]:BOOL:(yes no)' \
85 '--service-txt=[Do not resolve TXT records for services]:BOOL:(yes no)' \
86 '--cname=[Do not follow CNAME redirects]:BOOL:(yes no)' \
87 '--validate=[Do not allow DNSSEC validation]:BOOL:(yes no)' \
88 '--synthesize=[Do not allow synthetic response]:BOOL:(yes no)' \
89 '--cache=[Do not allow response from cache]:BOOL:(yes no)' \
90 '--stale-data=[Do not allow response from cache with stale data]:BOOL:(yes no)' \
91 '--zone=[Do not allow response from locally registered mDNS/LLMNR records]:BOOL:(yes no)' \
92 '--trust-anchor=[Do not allow response from local trust anchor]:BOOL:(yes no)' \
93 '--network=[Do not allow response from network]:BOOL:(yes no)' \
94 '--search=[Do not use search domains]:BOOL:(yes no)' \
95 '--raw=[Dump the answer as binary data]:RAW:(payload packet)' \
96 '--json=[Output as JSON]:JSON:(pretty short off)' \
97 '--no-pager[Do not pipe output into a pager]' \
98 '--no-ask-password[Do not prompt for password]' \
99 '*::default: _resolvectl_commands'