zsh-workers
 help / color / mirror / code / Atom feed
From: "Thomas Köhler" <jean-luc@picard.franken.de>
To: Oliver Kiddle <okiddle@yahoo.co.uk>,
	Zsh hackers list <zsh-workers@sunsite.dk>
Subject: Re: scp completion
Date: Tue, 3 Sep 2002 17:20:23 +0200	[thread overview]
Message-ID: <20020903152023.GA8799@picard.franken.de> (raw)
In-Reply-To: <20020903151052.GA6194@picard.franken.de>

[-- Attachment #1: Type: text/plain, Size: 2428 bytes --]

Hi,

Thomas Köhler wrote [2002/09/03 17:10]:
> Oliver Kiddle wrote [2002/09/03 11:11]:
> > On 2 Sep, you wrote:
> > > 
> > > zsh's completion for scp lacks a feature :)
> > 
> > > That doesn't work when I have to use "-P" to scp:
> > > 
> > > scp -P 2222 foo@bar:/some/path<TAB>
> > 
> > Yes, we need to pass the port number on to the ssh command used to get
> > the list of files to complete.
> > 
> > > Is there any chance that this feature will be implemented soon or
> > 
> > Patch below should do it.
> > 
> > Can anyone think of which if any of the other scp options should be
> > passed on? I've got it to also pass on -1,-2,-4 and -6.
> 
> Uhm, yes. I need also -F :-)
> 
> Tried to add that one, but somehow it didn't work. Can't have a
> look at that one now, will have to wait until later...

Oh well, one quick idea showed what's wrong. I used the following
patch on top of Oliver's:

-----------------------------
~/zsh/functions> diff -u _ssh\~ _ssh
--- _ssh~       2002-09-03 14:45:38.000000000 +0200
+++ _ssh        2002-09-03 17:15:37.000000000 +0200
@@ -5,7 +5,7 @@
   local expl remfiles remdispf remdispd args suf ret=1
 
   if zstyle -T ":completion:${curcontext}:" remote-access; then
-    zparseopts -D -E -a args p: 1 2 4 6
+    zparseopts -D -E -a args p: 1 2 4 6 F:
     remfiles=(${(M)${(f)"$(ssh $args -a -x ${words[CURRENT]%%:*} ls -d1F ${PREFIX%%[^./][^/]#}\* 2>/dev/null)"}%%[^/]#(|/)})
     compset -P '*/'
     compset -S '/*' || suf='remote file'
@@ -263,7 +263,7 @@
       ;;
     file)
       if compset -P '*:'; then
-        _remote_files ${(kv)opt_args[(I)-[P1246]]/-P/-p} && ret=0
+        _remote_files ${(kv)opt_args[(I)-[FP1246]]/-P/-p} && ret=0
       elif compset -P '*@'; then
         _wanted hosts expl host _ssh_hosts -S: && ret=0
       else
-----------------------------

Now - scp completion didn't work for me - until I used

   scp -F /home/jean-luc/.ssh/config.special -P 2222 tkoehler@localhost:

instead of

   scp -F ~/.ssh/config.special -P 2222 tkoehler@localhost:

How can I avoid the "~" problem?

Ciao,
Thomas

-- 
 Thomas Köhler Email:   jean-luc@picard.franken.de     | LCARS - Linux
     <><        WWW:     http://jeanluc-picard.de      | for Computers
                IRC:             jeanluc               | on All Real
               PGP public key available from Homepage! | Starships

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2002-09-04  6:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-02 16:37 Thomas Köhler
2002-09-03  9:02 ` Oliver Kiddle
2002-09-03 15:10   ` Thomas Köhler
2002-09-03 15:20     ` Thomas Köhler [this message]
2002-09-03 16:24       ` Oliver Kiddle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020903152023.GA8799@picard.franken.de \
    --to=jean-luc@picard.franken.de \
    --cc=okiddle@yahoo.co.uk \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).