From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12067 invoked from network); 3 Sep 2002 09:03:45 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 3 Sep 2002 09:03:45 -0000 Received: (qmail 97 invoked by alias); 3 Sep 2002 09:03:37 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17607 Received: (qmail 71 invoked from network); 3 Sep 2002 09:03:36 -0000 X-VirusChecked: Checked cc: Zsh hackers list In-reply-to: <20020902163741.GA2240@picard.franken.de> From: Oliver Kiddle References: <20020902163741.GA2240@picard.franken.de> To: Thomas =?iso-8859-1?Q?K=F6hler?= Subject: Re: scp completion Date: Tue, 03 Sep 2002 10:02:37 +0100 Sender: kiddleo@logica.com Message-Id: 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 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.