1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-19 13:33:52 +01:00

Konstantin Sobolev: 20832 (modified): gather targets from imported files

This commit is contained in:
Oliver Kiddle 2005-02-24 17:05:46 +00:00
parent ebe071866d
commit 230872fa10
2 changed files with 7 additions and 1 deletions

@ -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

@ -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