summaryrefslogtreecommitdiffstats
path: root/Completion/User/_socket
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-11-15 12:01:46 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-11-15 12:01:46 +0000
commit35b2633ad941966f5fca07b625a594a5b68c0fdb (patch)
treeb54740d014e594ba5d81931cdcdb3387bcf9dfca /Completion/User/_socket
parentzsh-workers/8640 (diff)
downloadzsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.tar
zsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.tar.gz
zsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.tar.bz2
zsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.tar.lz
zsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.tar.xz
zsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.tar.zst
zsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.zip
manual/8639
Diffstat (limited to 'Completion/User/_socket')
-rw-r--r--Completion/User/_socket32
1 files changed, 10 insertions, 22 deletions
diff --git a/Completion/User/_socket b/Completion/User/_socket
index ad9232af9..b155e7ad4 100644
--- a/Completion/User/_socket
+++ b/Completion/User/_socket
@@ -5,19 +5,14 @@
# socket_hosts_ports
# The array that contains paris `host:port'.
-local context state line expl
+local curcontext="$curcontext" state line expl
typeset -A opt_args
-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
+[[ $CURRENT -eq 2 ]] && _wanted options expl option &&
+ { ! _style options prefix-needed || [[ "$PREFIX" = -* ]] } &&
+ compadd -M 'r:|[_-]=* r:|=*' "$expl[@]" - -version
-_arguments -s \
+_arguments -C -s \
'-b[background]' \
'-c[crlf]' \
'-f[fork]' \
@@ -43,24 +38,17 @@ command)
arg1)
if (( $+opt_args[-s] )); then
- _tags "$context" ports || return 1
-
- _description expl 'port to listen'
- _ports "$expl[@]"
+ _wanted ports expl 'port to listen' && _ports "$expl[@]"
else
- _tags "$context" hosts || return 1
-
- _description expl 'host'
- _combination socket_hosts_ports hosts "$expl[@]"
+ _wanted hosts expl 'host' &&
+ _combination socket_hosts_ports hosts "$expl[@]"
fi
;;
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[@]"
+ _wanted ports expl 'port to connect' &&
+ _combination socket_hosts_ports hosts="${line[2]:q}" ports "$expl[@]"
fi
;;
esac