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

Re: [SUBMIT] _ant completion function



--- Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
> In the latter half, after determining that $i is a directory, why does it
> then ignore $i when putting together a list based on .class files? Seems
> strange to me.
Yes is a bug, it should be looking for class files under $i.

> Can a classpath contain things like '*.jar' or for _ant should it be
> expanding the glob.

Classpath can not contain globs as far as I know.

> There is a better way. Have a look in _figlet for an example. Basically
> you can use an _arguments spec which looks something like this:
> '*:class:_java_class -cp ${(v)~opt_args[(i)(-cp|-classpath)]\:-$CLASSPATH}'
> so no states are needed.
> 
> It'd be cleaner if _java_class just had an argument to specify the
> classpath like this.

That's better (and correct).  Though it is not compact, not sure what can
be done about that.

> > Also, adding caching for the build.xml targets/descriptions, and
> > for _java_class jar files.
> 
> For cacheing the contents of jar files, it might be wise to use the same
> cache used by _zip and allow jar completion to also use it.

I'm not quite sure I understand exactly how that would work.  The _zip
cache assumes that there is a single zip file that is being cached.
It seems like the _java_class code would be thrashing the cache.

In my situation, I typically will have multiple jar-type files in
my CLASSPATH.  Some jars are from third parties, so they are mostly static.
Other jars have code that changes frequently.  So
it would be nice if there was a per file cache, that would only be
updated as the jar files changed.  Also, it would be useful if the
cache was based on the complete path of the jar file, not just the basename
of the jar, since it is possible to have different versions of the same jar.

Also, feel free to fix _java_class, I don't have much time.

-FR.



__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com



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