diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Completion/Unix/Command/_ssh | 9 |
2 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog index 6145549d2..0a6a8cf23 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-02-04 Clint Adams <clint@zsh.org> + + * 16553: Completion/Unix/Command/_ssh: differentiate between + files and directories during remote scp completion. + 2002-02-03 Felix Rosencrantz <f_rosencrantz@yahoo.com> * 16546: Completion/Unix/Command/_cvs, diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh index 7d1d95d7c..8830db6ee 100644 --- a/Completion/Unix/Command/_ssh +++ b/Completion/Unix/Command/_ssh @@ -3,11 +3,16 @@ _remote_files () { # This is extremely simple-minded; could parse "ls -F" output to do # colorings and LIST_TYPES and so on, but I'm just not that ambitious. - local expl + local expl remfiles if zstyle -T ":completion:${curcontext}:" remote-access; then + remfiles=(${(f)"$(ssh -a -x ${words[CURRENT]%:*} ls -d1F ${words[CURRENT]#*:}\*)"}) + _wanted files expl 'remote files' \ - compadd $(ssh -a -x ${words[CURRENT]%:*} echo ${words[CURRENT]#*:}\*) + compadd ${${remfiles:#*/}/[*=@](#e)/} + + _wanted dirs expl 'remote directories' \ + compadd -S/ ${${(M)remfiles:#*/}/\\/(#e)/} else _message 'remote files' fi |