zsh-workers
 help / color / mirror / code / Atom feed
d81669c0006283fcb8f78e7751ed0aa475a828ce blob 656 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 
#autoload

# Should probably add some sort of cache.
# Should we call _multi_parts instead of compadd?

local classpath i expl
local -a c
local method type

zparseopts -D -E -a classpath t:=type m:=method cp: classpath:
: "$classpath[@]"
classpath="${${classpath[2]:-${CLASSPATH:-.}}//\\:/:}"
: "$classpath[@]"

for i in "${(s.:.)classpath}"; do
  if [ -f $i ] && [[ "$i" == *.(jar|zip|war|ear) ]]; then
    c+=( ${${${(M)$(_call_program jar_classes jar -tf $i)##*.class}%%.class}:gs#/#.#} )
  elif [ -d $i ]; then
    c+=( $i/**/*.class(.:r:s/.class//:s#$i/##:gs#/#.#) )
  fi
done

_wanted classes expl 'java class' compadd "$@" -M 'r:|.=* r:|=*' -a - c

debug log:

solving d81669c ...
found d81669c in https://git.vuxu.org/mirror/zsh/

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).