From 5e592fd9b0d0d5a0532ffa57667b3f5e7c09fa92 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Tue, 21 Oct 2014 20:53:51 +0200 Subject: 33485: fixes for zstyle context handling --- Completion/Zsh/Command/_tcpsys | 18 +++++------------- Completion/Zsh/Command/_zattr | 7 ++++--- 2 files changed, 9 insertions(+), 16 deletions(-) (limited to 'Completion/Zsh') 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 -- cgit 1.4.1