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

[PATCH] Ant completion improvement



Hello!

Thanks for zsh: it's great.

The example below does not return completion for the "build" target
without the patch (replace ^Is with tabs):

^I^I<target name="build" depends="init">

The example below does not return completion for the "build" target
without the patch:

<target depends="init" name="build">

Please find attached a patch against 4.2.1 to allow ant completion to:

1) match leading tabs before the <target/> elements
2) match the target's "name" attribute not just on the first position

Thanks in advance,
-- 
Jean-Baptiste Quenot
http://caraldi.com/jbq/
--- _ant.orig	Mon Dec  6 11:22:13 2004
+++ _ant	Mon Dec  6 11:40:46 2004
@@ -86,7 +86,7 @@
 	buildfile=${(v)opt_args[(I)(-f|-file|-buildfile)]:-build.xml}
       fi
       if [[ -f $buildfile ]]; then
-        targets=( $(sed -n "s/ *<target name=[\"']\([^\"']*\)[\"'].*/\1/p" < $buildfile) )
+        targets=( $(sed -n "s/[ 	]*<target *[^>]* name=[\"']\([^\"']*\)[\"'].*/\1/p" < $buildfile) )
 	_wanted targets expl target compadd -a targets && ret=0
       else
 	_message -e targets target


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