zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: _ssh (scp)
@ 2002-02-04 17:59 Clint Adams
  2002-02-04 18:25 ` Bart Schaefer
  2002-02-05 10:24 ` Oliver Kiddle
  0 siblings, 2 replies; 10+ messages in thread
From: Clint Adams @ 2002-02-04 17:59 UTC (permalink / raw)
  To: zsh-workers; +Cc: david

So this is based on a patch from David Engel for something resembling
the current 4.0.x CVS.  Is it necessary to provide the echo behavior
as well, or can we safely assume that everything can do ls -d1F these
days?

Index: Completion/Unix/Command/_ssh
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_ssh,v
retrieving revision 1.5
diff -u -r1.5 _ssh
--- Completion/Unix/Command/_ssh	2002/01/16 16:29:52	1.5
+++ Completion/Unix/Command/_ssh	2002/02/04 17:25:18
@@ -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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2002-02-06 18:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-04 17:59 PATCH: _ssh (scp) Clint Adams
2002-02-04 18:25 ` Bart Schaefer
2002-02-04 18:43   ` Clint Adams
2002-02-05 10:24 ` Oliver Kiddle
2002-02-05 17:47   ` Clint Adams
2002-02-05 18:08     ` Clint Adams
2002-02-05 18:38       ` Bart Schaefer
2002-02-06 16:43         ` Clint Adams
2002-02-06 16:59           ` Borsenkow Andrej
2002-02-06 18:12             ` The :h modifier Brass Lantern Enterprises

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).