From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24220 invoked from network); 4 Sep 2002 06:51:13 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 4 Sep 2002 06:51:13 -0000 Received: (qmail 26500 invoked by alias); 4 Sep 2002 06:51:01 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17610 Received: (qmail 26398 invoked from network); 4 Sep 2002 06:50:55 -0000 Date: Tue, 3 Sep 2002 17:20:23 +0200 From: Thomas =?iso-8859-1?Q?K=F6hler?= To: Oliver Kiddle , Zsh hackers list Subject: Re: scp completion Message-ID: <20020903152023.GA8799@picard.franken.de> Mail-Followup-To: Oliver Kiddle , Zsh hackers list References: <20020902163741.GA2240@picard.franken.de> <20020903151052.GA6194@picard.franken.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0OAP2g/MAC+5xKAE" Content-Disposition: inline In-Reply-To: <20020903151052.GA6194@picard.franken.de> User-Agent: Mutt/1.4i X-Operating-System: Linux picard 2.4.18 X-Editor: VIM - Vi IMproved 6.1 http://www.vim.org/ X-IRC: tirc; Nick: jeanluc X-URL: http://jeanluc-picard.de/ --0OAP2g/MAC+5xKAE Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, Thomas K=F6hler wrote [2002/09/03 17:10]: > Oliver Kiddle wrote [2002/09/03 11:11]: > > On 2 Sep, you wrote: > > >=20 > > > zsh's completion for scp lacks a feature :) > >=20 > > > That doesn't work when I have to use "-P" to scp: > > >=20 > > > scp -P 2222 foo@bar:/some/path > >=20 > > Yes, we need to pass the port number on to the ssh command used to get > > the list of files to complete. > >=20 > > > Is there any chance that this feature will be implemented soon or > >=20 > > Patch below should do it. > >=20 > > 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. >=20 > Uhm, yes. I need also -F :-) >=20 > 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=3D1 =20 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=3D(${(M)${(f)"$(ssh $args -a -x ${words[CURRENT]%%:*} ls -d1F= ${PREFIX%%[^./][^/]#}\* 2>/dev/null)"}%%[^/]#(|/)}) compset -P '*/' compset -S '/*' || suf=3D'remote file' @@ -263,7 +263,7 @@ ;; file) if compset -P '*:'; then - _remote_files ${(kv)opt_args[(I)-[P1246]]/-P/-p} && ret=3D0 + _remote_files ${(kv)opt_args[(I)-[FP1246]]/-P/-p} && ret=3D0 elif compset -P '*@'; then _wanted hosts expl host _ssh_hosts -S: && ret=3D0 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 --=20 Thomas K=F6hler 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 --0OAP2g/MAC+5xKAE Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9dNM3TEYXWMJlHuYRArlzAJ9soC/ZtfFviIoaVzQ2Vgiw+LiNnwCeIper FHRQPXhg7zD5UAlw49DlRKI= =2w9M -----END PGP SIGNATURE----- --0OAP2g/MAC+5xKAE--