about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2005-02-24 17:05:46 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2005-02-24 17:05:46 +0000
commit230872fa10ed0e9db8d1ca2818ce1a5b8a321928 (patch)
tree7289042c3edf9aca886972d0cae48a48146ce9f5
parentebe071866d8098f1975e3b90dc4f6d81a6b38b31 (diff)
downloadzsh-230872fa10ed0e9db8d1ca2818ce1a5b8a321928.tar.gz
zsh-230872fa10ed0e9db8d1ca2818ce1a5b8a321928.tar.xz
zsh-230872fa10ed0e9db8d1ca2818ce1a5b8a321928.zip
Konstantin Sobolev: 20832 (modified): gather targets from imported files
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Command/_ant5
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 358013907..7f2706dd6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2005-02-24  Oliver Kiddle  <opk@zsh.org>
 
+	* Konstantin Sobolev: 20832 (modified):
+	Completion/Unix/Command/_ant: gather targets from imported files
+
 	* 20862: configure.ac, Src/system.h, Src/utils.c: attempt to
 	fix configure scripts to detect iconv properly
 
diff --git a/Completion/Unix/Command/_ant b/Completion/Unix/Command/_ant
index 73d193991..184278662 100644
--- a/Completion/Unix/Command/_ant
+++ b/Completion/Unix/Command/_ant
@@ -2,6 +2,7 @@
 
 typeset -A opt_args
 local buildfile tmp state line curcontext="$curcontext" ret=1
+local targets importedfiles
 local c target='*:target:->target'
 
 c=( $ANT_HOME/lib/*.jar )
@@ -86,7 +87,9 @@ case $state in
 	buildfile=${(v)opt_args[(I)(-f|-file|-buildfile)]:-build.xml}
       fi
       if [[ -f $buildfile ]]; then
-        targets=( $(sed -n "s/ *<target[^>]* name=[\"']\([^\"']*\)[\"'].*/\1/p" < $buildfile) )
+        importedfiles=( $(sed -n "s/ *<import[^>]* file=[\"']\([^\"']*\)[\"'].*/\1/p" < $buildfile) )
+        targets=( $(cat $buildfile $importedfiles |
+	    sed -n "s/ *<target[^>]* name=[\"']\([^\"']*\)[\"'].*/\1/p" ) )
 	_wanted targets expl target compadd -a targets && ret=0
       else
 	_message -e targets target