about summary refs log tree commit diff
path: root/Completion/User/_ports
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-31 09:38:25 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-31 09:38:25 +0000
commitfd25b24df6b4f098944c4994195d3894a27a8208 (patch)
tree53f7f940844ab34c7349506622fc8241c782f98c /Completion/User/_ports
parent4629133ad33dacef459ad9fa5ca438836a1be9fb (diff)
downloadzsh-fd25b24df6b4f098944c4994195d3894a27a8208.tar.gz
zsh-fd25b24df6b4f098944c4994195d3894a27a8208.tar.xz
zsh-fd25b24df6b4f098944c4994195d3894a27a8208.zip
use compadd -[ak] (11549)
Diffstat (limited to 'Completion/User/_ports')
-rw-r--r--Completion/User/_ports12
1 files changed, 8 insertions, 4 deletions
diff --git a/Completion/User/_ports b/Completion/User/_ports
index 950212832..958917bd6 100644
--- a/Completion/User/_ports
+++ b/Completion/User/_ports
@@ -1,8 +1,12 @@
 #autoload
 
-local expl
+local expl ports
 
-: ${(A)ports:=${${(M)${${(f)"$(</etc/services)"}:#\#*}#*/tcp}%%[ 	]*}}
+if ! zstyle -a ":completion:${curcontext}:" ports ports; then
+  (( $+_cache_ports )) ||
+      : ${(A)_cache_ports:=${${(M)${${(f)"$(</etc/services)"}:#\#*}#*/tcp}%%[ 	]*}}
 
-_description expl port
-compadd "$@" "$expl[@]" - "$ports[@]"
+  ports=( "$_cache_ports[@]" )
+fi
+
+_wanted ports expl port compadd "$@" -a ports