1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-09-21 19:31:50 +02:00

21698: Jean-Baptiste Quenot: _ant recursive completion could change dir

This commit is contained in:
Peter Stephenson 2005-09-05 13:55:47 +00:00
parent 9b05a714c3
commit 394ab0aeb7
2 changed files with 10 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2005-09-05 Peter Stephenson <pws@csr.com>
* 21698: Jean-Baptiste Quenot: Completion/Unix/Command/_ant:
recursive completion could change directory.
2005-09-02 Clint Adams <clint@zsh.org>
* 21696: Completion/Unix/Command/_date: completion for

View File

@ -8,14 +8,13 @@ local buildfile classpath cp userjars importedfiles target='*:target:->target' t
find_targets() {
importedfiles=( $(sed -n "s/ *<import[^>]* file=[\"']\([^\"']*\)[\"'].*/\1/p" < $1) )
targets=( $(sed -n "s/ *<target[^>]* name=[\"']\([^\"']*\)[\"'].*/\1/p" $1) )
sed -n "s/ *<target[^>]* name=[\"']\([^\"']*\)[\"'].*/\1/p" $1
if (( $#importedfiles )) ; then
cd $1:h
( cd $1:h
for file in $importedfiles ; do
find_targets $file
done
done )
fi
_wanted targets expl target compadd -a targets && ret=0
}
if [[ $service = *ANT_ARGS* ]]; then
@ -126,7 +125,8 @@ case $state in
)//$'\015'}"
_describe 'target' tmp && ret=0
else
find_targets $buildfile
targets=( $(find_targets $buildfile) )
_wanted targets expl target compadd -a targets && ret=0
fi
else
_message -e targets target