From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14790 invoked from network); 3 Apr 2005 11:34:20 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 3 Apr 2005 11:34:20 -0000 Received: (qmail 88528 invoked from network); 3 Apr 2005 11:34:14 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 3 Apr 2005 11:34:14 -0000 Received: (qmail 15560 invoked by alias); 3 Apr 2005 11:34:11 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21086 Received: (qmail 15545 invoked from network); 3 Apr 2005 11:34:11 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 3 Apr 2005 11:34:11 -0000 Received: (qmail 88257 invoked from network); 3 Apr 2005 11:34:11 -0000 Received: from morda.newmail.ru (HELO flock1.newmail.ru) (212.48.140.150) by a.mx.sunsite.dk with SMTP; 3 Apr 2005 11:34:07 -0000 Received: (qmail 9565 invoked from network); 3 Apr 2005 11:15:39 -0000 Received: from unknown (HELO ?10.0.0.1?) (arvidjaar@newmail.ru@83.237.106.140) by smtpd.newmail.ru with SMTP; 3 Apr 2005 11:15:39 -0000 From: Andrey Borzenkov To: zsh-workers@sunsite.dk Subject: Re: [PATCH] _rsync - better rsync:// URL support and other fixes Date: Sun, 3 Apr 2005 15:34:02 +0400 User-Agent: KMail/1.7.2 References: <200503270037.01998.arvidjaar@newmail.ru> <10653.1112094049@trentino.groupinfra.com> In-Reply-To: <10653.1112094049@trentino.groupinfra.com> Content-Type: Multipart/Mixed; boundary="Boundary-00=_tS9TCn9XFOX6Wu4" Message-Id: <200504031534.05700.arvidjaar@newmail.ru> X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.5 required=6.0 tests=AWL,BAYES_00, MIME_HEADER_CTYPE_ONLY autolearn=no version=3.0.2 X-Spam-Hits: -2.5 --Boundary-00=_tS9TCn9XFOX6Wu4 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday 29 March 2005 15:00, Oliver Kiddle wrote: > On 27 Mar, Andrey wrote: > > Absolutely ugly "compadd -S/ rsync:/" is the only way I know to add word > > with two slashes without adding blank. Oliver, do you have any idea (the > > same problem I had in _urpmi too). > > It is possible to do: > compadd -S '' rsync:// > > Or is there some problem with that? > No. Thank you. The patch also fixes modules completion (broken in my last patch), stripes yet another MOTD (this starts to be amusing) and turns off rsync warnings. - -andrey -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCT9StR6LMutpd94wRAkoAAJ9iPfU56lLxnzD7sf/PYI//QDMDyACePDzU tMs/ttJxgosyiOkUOTLbgBM= =nDnr -----END PGP SIGNATURE----- --Boundary-00=_tS9TCn9XFOX6Wu4 Content-Type: text/x-diff; charset="utf-8"; name="_rsync.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="_rsync.diff" Index: Completion/Unix/Command/_rsync =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_rsync,v retrieving revision 1.21 diff -u -p -r1.21 _rsync --- Completion/Unix/Command/_rsync 28 Mar 2005 21:02:06 -0000 1.21 +++ Completion/Unix/Command/_rsync 3 Apr 2005 11:30:35 -0000 @@ -13,7 +13,7 @@ _rsync_user_or_host() { _wanted users expl "user" \ _combination -s '[:@]' "${tag}" users-hosts users -q "$@" - else - [[ $words[CURRENT] = rsync://* ]] || rsync='rsync:rsync: compadd -S/ rsync:/' + [[ $words[CURRENT] = rsync://* ]] || rsync='rsync:rsync: compadd -S "" rsync://' _alternative \ 'users:user:_users -S @' \ "hosts:host:_hosts -S '$suf'" \ @@ -26,7 +26,7 @@ local expl remfiles remdispf remdispd re if compset -P '*::*/' || compset -P 'rsync://*/*/'; then - remfiles=(${${(f)"$(_call_program files rsync ${words[CURRENT]%/*}/)"}:#[ ]*}) + remfiles=(${${(f)"$(_call_program files rsync ${words[CURRENT]%/*}/ 2>/dev/null)"}:#([ ]|MOTD:)*}) remdispf=(${remfiles:#d*}) remdispd=(${(M)remfiles:#d*}) @@ -41,11 +41,13 @@ elif compset -P 1 '*::' || compset -P 1 local pat=${words[CURRENT]} - if [[ $pat = *:: ]]; then + if [[ $pat = *::* ]]; then pat=${pat%::*}:: + else + pat=${pat%/*}/ fi - remfiles=(${${(f)"$(_call_program files rsync $pat)"}:#[ ]*}) + remfiles=(${${(f)"$(_call_program files rsync $pat 2>/dev/null)"}:#([ ]|MOTD:)*}) remmodules=(${remfiles/[ ]##/:}) --Boundary-00=_tS9TCn9XFOX6Wu4--