* PATCH: new completion for ant
@ 2002-08-09 15:21 Oliver Kiddle
0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2002-08-09 15:21 UTC (permalink / raw)
To: Zsh workers
New completion for ant (a java make-like tool).
Oliver
Index: Completion/Unix/Command/_ant
===================================================================
RCS file: Completion/Unix/Command/_ant
diff -N Completion/Unix/Command/_ant
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Completion/Unix/Command/_ant 9 Aug 2002 15:20:27 -0000
@@ -0,0 +1,38 @@
+#compdef ant -value-,ANT_ARGS,-default-
+
+typeset -A opt_args
+local state line curcontext="$curcontext"
+local target='*:target:->target'
+
+if [[ $service = *ANT_ARGS* ]]; then
+ compset -q
+ words=( fake "$words[@]" )
+ (( CURRENT++ ))
+ unset target
+fi
+
+_arguments -C \
+ '-help[display usage information]' \
+ '-projecthelp[print project hjelp 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 specfied file]:property file:_files' \
+ '-inputhandler[specify class which will handle input requests]:class:_java_class' \
+ '-find[search for buildfile]:file:_files' \
+ $target && return
+
+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
+fi
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-08-09 15:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-09 15:21 PATCH: new completion for ant Oliver Kiddle
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).