]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - shell-completion/zsh/_resolvectl
improve zsh completion (#32098)
[thirdparty/systemd.git] / shell-completion / zsh / _resolvectl
index 8a50fbdbbec46e10a7000363f75320311c74d298..94ff3950af963b5f9d0277e35174e903f3b4c57e 100644 (file)
@@ -1,4 +1,4 @@
-#compdef resolvectl systemd-resolve         -*- shell-script -*-
+#compdef resolvectl systemd-resolve
 # SPDX-License-Identifier: LGPL-2.1-or-later
 #
 # This file is part of systemd.
@@ -14,7 +14,7 @@
 # General Public License for more details.
 #
 # You should have received a copy of the GNU Lesser General Public License
-# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+# along with systemd; If not, see <https://www.gnu.org/licenses/>.
 
 (( $+functions[_resolvectl_protocols] )) ||
     _resolvectl_protocols() {
@@ -56,6 +56,7 @@
         reset-statistics:"Resets the statistics counter shown in statistics to zero"
         revert:"Revert the per-interfce DNS configuration"
         service:"Resolve DNS-SD and SRV services"
+        show-cache:"Show the current cache contents"
         statistics:"Show resolver statistics"
         status:"Show the global and per-link DNS settings currently in effect"
         tlsa:"Query tlsa public keys stored as TLSA resource records"
 }
 
 _arguments \
-    {-h,--help}'[Print a short help text and exit]' \
-    '--version[Print a short version string and exit]' \
-    '--legend=no[Do not show headers and footers]' \
+    '(- *)'{-h,--help}'[Print a short help text and exit]' \
+    '(- *)--version[Print a short version string and exit]' \
+    '--legend=[Do not show headers and footers]:BOOL:(yes no)' \
     '-4[Resolve IPv4 addresses]' \
     '-6[Resolve IPv6 addresses]' \
-    {-i+,--interface=}'[Look on interface]:interface:_net_interfaces' \
-    {-p+,--protocol=}'[Look via protocol]:protocol:_resolvectl_protocols' \
-    {-t+,--type=}'[Query RR with DNS type]:type:_resolvectl_types' \
-    {-c+,--class=}'[Query RR with DNS class]:class:_resolvectl_classes' \
+    '(-i --interface)'{-i+,--interface=}'[Look on interface]:interface:_net_interfaces' \
+    '(-p --protocol)'{-p+,--protocol=}'[Look via protocol]:protocol:_resolvectl_protocols' \
+    '(-t --type)'{-t+,--type=}'[Query RR with DNS type]:type:_resolvectl_types' \
+    '(-c --class)'{-c+,--class=}'[Query RR with DNS class]:class:_resolvectl_classes' \
     '--service[Resolve services]' \
-    '--service-address=no[Do not resolve address for services]' \
-    '--service-txt=no[Do not resolve TXT records for services]' \
-    '--cname=no[Do not follow CNAME redirects]' \
-    '--search=no[Do not use search domains]' \
+    '--service-address=[Do not resolve address for services]:BOOL:(yes no)' \
+    '--service-txt=[Do not resolve TXT records for services]:BOOL:(yes no)' \
+    '--cname=[Do not follow CNAME redirects]:BOOL:(yes no)' \
+    '--search=[Do not use search domains]:BOOL:(yes no)' \
     '*::default: _resolvectl_commands'