about summary refs log tree commit diff
path: root/Completion/Zsh
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2014-10-21 20:53:51 +0200
committerOliver Kiddle <opk@zsh.org>2014-10-21 20:53:51 +0200
commit5e592fd9b0d0d5a0532ffa57667b3f5e7c09fa92 (patch)
tree2af5203a95aac5a327f8cd7fd9e9a4e1f207192a /Completion/Zsh
parentaf9f623273eb994d36d3f02ed37bac6edb10c7cb (diff)
downloadzsh-5e592fd9b0d0d5a0532ffa57667b3f5e7c09fa92.tar.gz
zsh-5e592fd9b0d0d5a0532ffa57667b3f5e7c09fa92.tar.xz
zsh-5e592fd9b0d0d5a0532ffa57667b3f5e7c09fa92.zip
33485: fixes for zstyle context handling
Diffstat (limited to 'Completion/Zsh')
-rw-r--r--Completion/Zsh/Command/_tcpsys18
-rw-r--r--Completion/Zsh/Command/_zattr7
2 files changed, 9 insertions, 16 deletions
diff --git a/Completion/Zsh/Command/_tcpsys b/Completion/Zsh/Command/_tcpsys
index dcc6f6cc8..1240ffbf8 100644
--- a/Completion/Zsh/Command/_tcpsys
+++ b/Completion/Zsh/Command/_tcpsys
@@ -1,16 +1,16 @@
 #compdef tcp_open
 
-local context line expl nm=$compstate[nmatches]
-local -a state argargs sesslist
+local curcontext="$curcontext" state line expl
 local -A opt_args
+local -a argargs sesslist
 
 case $service in
   (tcp_open)
   argargs=(
     '(-a -f -l)-s[open session(s)]'
     '(-a -f -s)-l[open list of sessions]'
-    '(-f -s -l)-a[open session for accept on fd]:fd:->fd'
-    '(-a -s -l)-f[open session for accept on fd]:fd:->fd'
+    '(-f -s -l)-a[open session for accept on fd]:fd'
+    '(-a -s -l)-f[open session for accept on fd]:fd'
     '-q[quiet mode]'
     '-z[no zle handler]'
   )
@@ -19,7 +19,7 @@ case $service in
   elif [[ -n $words[(R)-(l|s)*] ]]; then
     argargs+=('*:session:->session')
   else
-    argargs+=(':host:->host' ':port:->port' '*:session:->session')
+    argargs+=(':host:_hosts' ':port:_ports' '*:session:->session')
   fi
   _arguments -C $argargs
   ;;
@@ -27,14 +27,6 @@ esac
 
 while (( $#state )); do
   case "$state[1]" in
-    (host)
-    _hosts
-    ;;
-
-    (port)
-    _ports
-    ;;
-
     (sessionlist)
     compset -P '*,'
     ;&
diff --git a/Completion/Zsh/Command/_zattr b/Completion/Zsh/Command/_zattr
index 1924bb28d..73564172b 100644
--- a/Completion/Zsh/Command/_zattr
+++ b/Completion/Zsh/Command/_zattr
@@ -1,7 +1,6 @@
 #compdef zgetattr zsetattr zdelattr zlistattr
 
-local state line expl ret=1 REPLY
-local -a args privs
+local context state line expl ret=1 REPLY
 
 case $service in
 zgetattr)
@@ -30,5 +29,7 @@ esac && ret=0
 
 if [[ $state = attrs ]]; then
   zlistattr ${~${(Q)line[1]}} REPLY 2> /dev/null
-  _wanted attrs expl 'attribute' compadd $REPLY
+  _wanted -C "$context[1]" attrs expl 'attribute' compadd -a REPLY && ret=0
 fi
+
+return ret