diff options
author | Robby Russell <robby@planetargon.com> | 2015-02-10 07:28:39 -0800 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2015-02-10 07:28:39 -0800 |
commit | 811f1f9eb93c9a8a8c554e0ecd0d7ccb377b5919 (patch) | |
tree | 63df5ab25bf69491497a52a65d92d59fa19a57b2 /plugins/ant/ant.plugin.zsh | |
parent | 935f1914f9a53fbb3c53e2b12f4f4a7d6e2a7484 (diff) | |
parent | 349493a0b81ae98117ea1a115a92ba509476298f (diff) | |
download | zsh-811f1f9eb93c9a8a8c554e0ecd0d7ccb377b5919.tar.gz zsh-811f1f9eb93c9a8a8c554e0ecd0d7ccb377b5919.tar.bz2 zsh-811f1f9eb93c9a8a8c554e0ecd0d7ccb377b5919.zip |
Merge pull request #3329 from capeterson/master
Improved ant completion
Diffstat (limited to 'plugins/ant/ant.plugin.zsh')
-rw-r--r-- | plugins/ant/ant.plugin.zsh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/ant/ant.plugin.zsh b/plugins/ant/ant.plugin.zsh index 45f2b06eb..0b738c94f 100644 --- a/plugins/ant/ant.plugin.zsh +++ b/plugins/ant/ant.plugin.zsh @@ -1,15 +1,15 @@ _ant_does_target_list_need_generating () { [ ! -f .ant_targets ] && return 0; - [ .ant_targets -nt build.xml ] && return 0; + [ build.xml -nt .ant_targets ] && return 0; return 1; } _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` + compadd -- `cat .ant_targets` fi } |