zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: "Thomas Köhler" <jean-luc@picard.franken.de>
Cc: Zsh hackers list <zsh-workers@sunsite.dk>
Subject: Re: scp completion
Date: Tue, 03 Sep 2002 10:02:37 +0100	[thread overview]
Message-ID: <E17m9a1-0005kq-00@bimbo.logica.co.uk> (raw)
In-Reply-To: <20020902163741.GA2240@picard.franken.de>

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.

Oliver

Index: Completion/Unix/Command/_ssh
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_ssh,v
retrieving revision 1.14
diff -u -r1.14 _ssh
--- Completion/Unix/Command/_ssh	16 Apr 2002 07:48:46 -0000	1.14
+++ Completion/Unix/Command/_ssh	3 Sep 2002 08:59:57 -0000
@@ -2,10 +2,11 @@
 
 _remote_files () {
   # There should be coloring based on all the different ls -F classifiers.
-  local expl remfiles remdispf remdispd suf ret=1
+  local expl remfiles remdispf remdispd args suf ret=1
 
   if zstyle -T ":completion:${curcontext}:" remote-access; then
-    remfiles=(${(M)${(f)"$(ssh -a -x ${words[CURRENT]%%:*} ls -d1F ${PREFIX%%[^./][^/]#}\* 2>/dev/null)"}%%[^/]#(|/)})
+    zparseopts -D -E -a args p: 1 2 4 6
+    remfiles=(${(M)${(f)"$(ssh $args -a -x ${words[CURRENT]%%:*} ls -d1F ${PREFIX%%[^./][^/]#}\* 2>/dev/null)"}%%[^/]#(|/)})
     compset -P '*/'
     compset -S '/*' || suf='remote file'
 
@@ -262,7 +263,7 @@
       ;;
     file)
       if compset -P '*:'; then
-        _remote_files && ret=0
+        _remote_files ${(kv)opt_args[(I)-[P1246]]/-P/-p} && ret=0
       elif compset -P '*@'; then
         _wanted hosts expl host _ssh_hosts -S: && ret=0
       else

This e-mail and any attachment is for authorised use by the intended recipient(s) only.  It may contain proprietary material, confidential information and/or be subject to legal privilege.  It should not be copied, disclosed to, retained or used by, any other party.  If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.  Thank you.


  reply	other threads:[~2002-09-03  9:03 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 [this message]
2002-09-03 15:10   ` Thomas Köhler
2002-09-03 15:20     ` Thomas Köhler
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=E17m9a1-0005kq-00@bimbo.logica.co.uk \
    --to=okiddle@yahoo.co.uk \
    --cc=jean-luc@picard.franken.de \
    --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).