summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Type/_ports12
1 files changed, 12 insertions, 0 deletions
diff --git a/Completion/Unix/Type/_ports b/Completion/Unix/Type/_ports
new file mode 100644
index 000000000..958917bd6
--- /dev/null
+++ b/Completion/Unix/Type/_ports
@@ -0,0 +1,12 @@
+#autoload
+
+local expl ports
+
+if ! zstyle -a ":completion:${curcontext}:" ports ports; then
+  (( $+_cache_ports )) ||
+      : ${(A)_cache_ports:=${${(M)${${(f)"$(</etc/services)"}:#\#*}#*/tcp}%%[ 	]*}}
+
+  ports=( "$_cache_ports[@]" )
+fi
+
+_wanted ports expl port compadd "$@" -a ports