From 6818d4f69732c2547f589cba9d9c7e0b73ee6310 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Mon, 13 Sep 1999 18:22:21 +0000 Subject: zsh-workers/7815 --- Completion/User/_socket | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'Completion/User/_socket') diff --git a/Completion/User/_socket b/Completion/User/_socket index c7605a1ac..ff8009ea1 100644 --- a/Completion/User/_socket +++ b/Completion/User/_socket @@ -2,10 +2,8 @@ # Parameter used: # -# socket_ports -# The associative array that maps a host name to a space-separated list of -# ports. - +# socket_hosts_ports +# The array that contains paris `host:port'. local state line expl typeset -A options @@ -28,18 +26,14 @@ arg1) _message 'port to listen' else _description expl 'host' - compadd "$expl[@]" - ${(k)socket_ports} || _hosts "$expl[@]" + _combination socket_hosts_ports hosts "$expl[@]" fi ;; arg2) if (( ! $+options[-s] )); then _description expl 'port to connect' - if (( $+socket_ports )); then - compadd "$expl[@]" - ${=socket_ports[$line[2]]}; - else - _message 'port to connect'; - fi + _combination socket_hosts_ports hosts="${line[2]:q}" ports "$expl[@]" fi ;; esac -- cgit 1.4.1