summary refs log tree commit diff
path: root/Completion
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 /Completion
parentebe071866d8098f1975e3b90dc4f6d81a6b38b31 (diff)
downloadzsh-230872fa10ed0e9db8d1ca2818ce1a5b8a321928.tar.gz
zsh-230872fa10ed0e9db8d1ca2818ce1a5b8a321928.tar.xz
zsh-230872fa10ed0e9db8d1ca2818ce1a5b8a321928.zip
Konstantin Sobolev: 20832 (modified): gather targets from imported files
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_ant5
1 files changed, 4 insertions, 1 deletions
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