summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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