summaryrefslogtreecommitdiffstats
path: root/Completion/User/_socket
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-11-12 15:28:24 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-11-12 15:28:24 +0000
commite6282df1155e8d9b08b2e518a452c1997973f1ce (patch)
treeb0c8ed7e8512cc4397ae7df6d138ea66147565b3 /Completion/User/_socket
parentzsh-workers/8617 (diff)
downloadzsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.tar
zsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.tar.gz
zsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.tar.bz2
zsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.tar.lz
zsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.tar.xz
zsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.tar.zst
zsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.zip
manual/8630
Diffstat (limited to 'Completion/User/_socket')
-rw-r--r--Completion/User/_socket17
1 files changed, 12 insertions, 5 deletions
diff --git a/Completion/User/_socket b/Completion/User/_socket
index e43c14c24..ad9232af9 100644
--- a/Completion/User/_socket
+++ b/Completion/User/_socket
@@ -5,13 +5,14 @@
# socket_hosts_ports
# The array that contains paris `host:port'.
-local state line expl
+local context state line expl
typeset -A opt_args
-if [[ $CURRENT -eq 2 && (
- -z "$compconfig[option_prefix]" ||
- "$compconfig[option_prefix]" = *\!${words[1]}* ||
- "$PREFIX" = -* ) ]]; then
+if _tags any options &&
+ [[ $CURRENT -eq 2 && (
+ -z "$compconfig[option_prefix]" ||
+ "$compconfig[option_prefix]" = *\!${words[1]}* ||
+ "$PREFIX" = -* ) ]]; then
_description expl option
compadd -M 'r:|[_-]=* r:|=*' "$expl[@]" - -version
fi
@@ -42,9 +43,13 @@ command)
arg1)
if (( $+opt_args[-s] )); then
+ _tags "$context" ports || return 1
+
_description expl 'port to listen'
_ports "$expl[@]"
else
+ _tags "$context" hosts || return 1
+
_description expl 'host'
_combination socket_hosts_ports hosts "$expl[@]"
fi
@@ -52,6 +57,8 @@ arg1)
arg2)
if (( ! $+opt_args[-s] )); then
+ _tags "$context" ports || return 1
+
_description expl 'port to connect'
_combination socket_hosts_ports hosts="${line[2]:q}" ports "$expl[@]"
fi