From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3747 invoked from network); 5 Jun 2000 15:05:12 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 5 Jun 2000 15:05:12 -0000 Received: (qmail 7541 invoked by alias); 5 Jun 2000 15:05:03 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11752 Received: (qmail 7488 invoked from network); 5 Jun 2000 15:04:59 -0000 From: "Bart Schaefer" Message-Id: <1000605150304.ZM25499@candle.brasslantern.com> Date: Mon, 5 Jun 2000 15:03:04 +0000 In-Reply-To: <200006050854.KAA03756@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: PATCH: complete rpm --{resign,addsign} in local" (Jun 5, 10:54am) References: <200006050854.KAA03756@beta.informatik.hu-berlin.de> <1000605011855.ZM20257@candle.brasslantern.com> <393B7736.13C3C00B@u.genie.co.uk> In-Reply-To: <393B7736.13C3C00B@u.genie.co.uk> Comments: In reply to Oliver Kiddle "Re: PATCH: complete rpm --{resign,addsign} in local" (Jun 5, 10:47am) X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: complete rpm --{resign,addsign} in local MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 5, 10:54am, Sven Wischnowsky wrote: } Subject: Re: PATCH: complete rpm --{resign,addsign} in local } } Bart Schaefer wrote: } } > On Jun 4, 5:09pm, Clint Adams wrote: } > } } > } zsh is still completing filenames directly after rpm -qcp or -qpc, } > } with no space, FWIW. } > } > Currently _rpm uses `-p+' as the spec for the -p option. That means that } > anything that will follow the -p (including package file name) is allowed } > to appear in the same word, or in the next word. } } Hrm. So we have to make it complete option arguments in the next } word(s) even if the option string doesn't end in the option, right? In this case, that's correct. It's analogous to tar fvxz foo.tar.gz (The _approximate and _correct completers have a wonderful time with tar, by the way.) } What makes me cringe is the case where we have -xy and both options } have arguments... You mean like `tar fvcbz foo.tar.gz 1024 foo'? I don't think it's incumbent upon _arguments to handle this without help; that's exactly what the state machine is for. It just has to be possible to tell _arguments that other option letters are allowed in the string of options even after one that has a following argument, so that it can go to the right next state. This could be done by something like `_arguments -s+ ...' if it's too awful to come up with still more OPTSPEC syntax (which I'm beginning to believe that it is). On Jun 5, 10:47am, Oliver Kiddle wrote: } Subject: Re: PATCH: complete rpm --{resign,addsign} in local } } Bart Schaefer wrote: } } > Meanwhile, it ought to complete http URLs as well as ftp. } } Shouldn't we be calling _urls here instead of partially repeating it? _rpm doesn't really repeat any of _urls. It makes no attempt to complete whatever comes after the host name. } It shouldn't be too hard to adapt _urls to pass any -g options to any } _files so we could tell it here to complete .rpm files only. The only } slightly messy part would be preventing it from completing gopher and } file urls; any ideas? If you leave a `compset -P ...' and `compadd ftp:// http://' in _rpm and simply replace the call to _hosts with a call to _urls, that should be enough to restrict the URL types, shouldn't it? Oh, but it's not, because _urls doesn't handle IPREFIX properly. It'll happily complete http:// into http://gopher:// ... Of course the compadd in _rpm needs a `-S ""' added to it. Which reminds me ... I tried changing that compadd to be: _alternative ... 'prefixes:URL prefix:compadd \ ftp://' to try to force a leading space onto the command line, but what got put on the command line *included* the backslash. What's up with that? It works to put a backslashed space in the pattern for '_files -g ...'. } Peter: A build I set off on Saturday on AIX has failed with one of the } usual dependency problems so don't make any releases until I've commited Oops. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net