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

[PATCH] ant completion



Dear workers,

Please find  attached a  patch for  ant completion.   The current
ant  completion  script  only  works when  the  "name"  attribute
immediately follows the "target" element name.

In  the following  example, zsh  only offers  completion for  the
'othertarget' target:

<target name='othertarget'/>
<target depends='othertarget' name='mytarget'/>

Best regards,
-- 
Jean-Baptiste Quenot
http://caraldi.com/jbq/
--- _ant.orig	Tue Aug 24 14:40:26 2004
+++ _ant	Tue Aug 24 14:51:38 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