From 7125514c462ac366ca0c6ed0d2f15b4d4ad4a79a Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Thu, 30 Apr 2009 18:02:08 +0000 Subject: users/14076 + workers/26906: Completion/Unix/Command/_ssh: fix autoremoval of some suffixes. --- ChangeLog | 9 ++++++++- Completion/Unix/Command/_ssh | 10 +++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7324648cf..b1c551a15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-04-30 Barton E. Schaefer + + * users/14076 (tweaked per 26906): Completion/Unix/Command/_ssh: + Add -q or -r: options to some compadd argument lists to properly + handle suffix removal when completing ssh option names or remote + host references in file names. + 2009-04-30 Peter Stephenson * c.f. 26895: Test/D07/multibyte.ztst: restrict the sorting test @@ -11644,5 +11651,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.4674 $ +* $Revision: 1.4675 $ ***************************************************** diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh index bc207bfd9..b7b407e2f 100644 --- a/Completion/Unix/Command/_ssh +++ b/Completion/Unix/Command/_ssh @@ -228,7 +228,7 @@ _ssh () { esac else _wanted values expl 'configure file option' \ - compadd -M 'm:{a-z}={A-Z}' -S '=' - \ + compadd -M 'm:{a-z}={A-Z}' -qS '=' - \ AddressFamily \ AFSTokenPassing BatchMode BindAddress \ ChallengeResponseAuthentication CheckHostIP \ @@ -294,12 +294,12 @@ _ssh () { _remote_files ${(kv)~opt_args[(I)-[FP1246]]/-P/-p} && ret=0 elif compset -P '*@'; then suf=( -S '' ) - compset -S ':*' || suf=( -S : ) + compset -S ':*' || suf=( -r: -S: ) _wanted hosts expl 'remote host name' _ssh_hosts $suf && ret=0 else _alternative \ 'files:: _files' \ - 'hosts:remote host name:_ssh_hosts -S:' \ + 'hosts:remote host name:_ssh_hosts -r: -S:' \ 'users:user:_ssh_users -qS@' && ret=0 fi ;; @@ -307,10 +307,10 @@ _ssh () { if compset -P '*:'; then _remote_files && ret=0 elif compset -P '*@'; then - _wanted hosts expl host _ssh_hosts -S: && ret=0 + _wanted hosts expl host _ssh_hosts -r: -S: && ret=0 else _alternative \ - 'hosts:remote host name:_ssh_hosts -S:' \ + 'hosts:remote host name:_ssh_hosts -r: -S:' \ 'users:user:_ssh_users -qS@' && ret=0 fi ;; -- cgit 1.4.1