about summary refs log tree commit diff
path: root/Completion/X/_xutils
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/X/_xutils')
-rw-r--r--Completion/X/_xutils24
1 files changed, 15 insertions, 9 deletions
diff --git a/Completion/X/_xutils b/Completion/X/_xutils
index a57f7be36..c0d94a998 100644
--- a/Completion/X/_xutils
+++ b/Completion/X/_xutils
@@ -55,23 +55,29 @@ xhost)
     if [[ "$tmp" = *:* ]]; then
       if compset -P '(#b)(*):'; then
 	type="$match[1]"
-	_wanted displays &&
-            while _next_label displays expl 'disallow access'; do
+	_tags displays
+	while _tags; do
+          while _next_label displays expl 'disallow access'; do
 	      { compadd "$expl[@]" -M 'm:{a-z}={A-Z} r:|[:.]=* r:|=*' - \
 		        ${${(M)tmp:#(#i)$type:*}#(#i)$type:} ||
-	            _hosts "$expl[@]" } && return 0
-	    done
+	            _hosts "$expl[@]" } && ret=0
+	  done
+	  (( ret )) || return 0
+        done
       else
 	_alternative \
 	    'types:name family:compadd -S: ${(L)tmp%%:*}' \
 	    'hosts:host:compadd ${(@)tmp#*:}' && ret=0
       fi
     else
-      _wanted displays &&
-          while _next_label displays expl 'disallow access'; do
-	    { compadd "$expl[@]" -M 'm:{a-z}={A-Z} r:|[:.]=* r:|=*' - $tmp ||
-              _hosts "$expl[@]" } && return 0
-          done
+      _tags displays
+      while _tags; do
+        while _next_label displays expl 'disallow access'; do
+	  { compadd "$expl[@]" -M 'm:{a-z}={A-Z} r:|[:.]=* r:|=*' - $tmp ||
+            _hosts "$expl[@]" } && ret=0
+        done
+	(( ret )) || return 0
+      done
     fi
   else
     compset -P +