Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Quoting problems with _zip (unzip) completer



On Wed, 3 Feb 2010, Mikael Magnusson wrote:

> >> > Peter Stephenson <pws@xxxxxxx> wrote:
> >> >> Mikael Magnusson wrote:
> >> >> > % unzip test\[.zip <tab>
> >> >> > _zip:117: bad pattern: test[.zip(|.zip|.ZIP)
> >> >> > _zip:117: bad pattern: test[.zip(|.zip|.ZIP)
> >> >> > _zip:117: bad pattern: test[.zip(|.zip|.ZIP)
> >
> > The exact test above is currently working for me, with my default 
> > completion setup.
> 
> As in, if that is an actual zip file with files in it, you get a 
> listing of those files?
> 
> 

Breaks for me w/ latest git.  Changing _zip line 117:
from      zipfile=( $~line[1](|.zip|.ZIP) )
to        zipfile=( $line[1](|.zip|.ZIP) )

fixes the 'test[.zip' case, but renaming 'test[.zip' to '*.zip' shows a 
weirder problem (present w/ or w/o the change):

$ unzip '*.zip' <TAB>
3 archives were successfully processed.
[Contents of a.zip]

The '3' comes from 'a.zip', 'test[.zip', and '*.zip'
$ cp a.zip b.zip
$ unzip '*.zip' <TAB>
4 archives were successfully processed.
[Contents of a.zip]

Even more interesting is that '*.zip' doesn't need to exist. :-)

Contents appear to be the first .zip in alpha order.

unzip -v
UnZip 6.00 of 20 April 2009, by Info-ZIP.[...]

(more version info available if needed)

-- 
Best,
Ben



Messages sorted by: Reverse Date, Date, Thread, Author