about summary refs log tree commit diff
path: root/Completion/Unix/Command/_ant
blob: e81fbfc0241b6b26ee1c0593ef39baa8d08accb0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#compdef ant

typeset -A opt_args
local state line curcontext="$curcontext" ret=1
local target='*:target:->target'

_arguments -C \
  '-help[display usage information]' \
  '-projecthelp[print project help information]' \
  '-version[display version information]' \
  '-diagnostics[display info useful to problem diagnosis]' \
  '(-q -quiet)'{-q,-quiet}'[be extra quiet]' \
  '(-v -verbose)'{-v,-verbose}'[be more verbose]' \
  '-debug[print debugging information]' \
  '-emacs[produce logging information without adornments]' \
  '(-l -logfile)'{-l,-logfile}'[use specified file for log]:logfile:_files' \
  '-logger[the class which is to perform logging]:classname:_java_class' \
  '-listener[add an instance of class as a project listener]:classname:_java_class' \
  '(-f -file -buildfile)'{-f,-file,-buildfile}'[use specified build file]:build file:_files' \
  '*-D[specify property with value to use]:property' \
  '-propertyfile[load properties from specified file]:property file:_files' \
  '-inputhandler[specify class which will handle input requests]:class:_java_class' \
  '-find[search for buildfile]:file:_files' \
  $target && ret=0

if [[ -n $state ]]; then
  targets=( $(sed -n 's/ *<target name="\([^"]*\)".*/\1/p' < build.xml) )
  # ant can be used to get a list of targets for us like this but it is slow
  # targets=( ${${(M)${(f)"$(_call_program targets $words[1] -projecthelp)"}:# *}# } )
  _wanted targets expl target compadd -a targets && ret=0
fi

return ret