summaryrefslogtreecommitdiff
path: root/plugins/ant
diff options
context:
space:
mode:
authorChris Peterson <cpeterson@financialforce.com>2014-11-17 20:43:19 -0800
committerChris Peterson <cpeterson@financialforce.com>2015-02-09 13:12:02 -0800
commit013b2bffcf11d0bc3ff29c96a8e6846166639c2c (patch)
tree861e411701bd63ffd8a5c1d7db48f999f1b72a6a /plugins/ant
parent7f636ba5901b1abe9bb01d94b9e290bed982a873 (diff)
downloadzsh-013b2bffcf11d0bc3ff29c96a8e6846166639c2c.tar.gz
zsh-013b2bffcf11d0bc3ff29c96a8e6846166639c2c.tar.bz2
zsh-013b2bffcf11d0bc3ff29c96a8e6846166639c2c.zip
Change ant target enumeration
Make use of ant's project help feature instead of trying to parse XML with regex (see: http://stackoverflow.com/a/1732454/740787). This is a behavioral change that does a few things: • adds support for ant imports, which were previously not recognized as possibly containing targets • supresses targets with no description, as these are conventionally for internal use only
Diffstat (limited to 'plugins/ant')
-rw-r--r--plugins/ant/ant.plugin.zsh2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/ant/ant.plugin.zsh b/plugins/ant/ant.plugin.zsh
index 38d13f2a8..a945967d5 100644
--- a/plugins/ant/ant.plugin.zsh
+++ b/plugins/ant/ant.plugin.zsh
@@ -7,7 +7,7 @@ _ant_does_target_list_need_generating () {
_ant () {
if [ -f build.xml ]; then
if _ant_does_target_list_need_generating; then
- sed -n '/<target/s/<target.*name="\([^"]*\).*$/\1/p' build.xml > .ant_targets
+ ant -p | awk -F " " 'NR > 5 { print lastTarget }{lastTarget = $1}' > .ant_targets
fi
compadd `cat .ant_targets`
fi