my xfce4 dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
419 B

3 years ago
  1. #compdef ant
  2. _ant_does_target_list_need_generating () {
  3. [[ ! -f .ant_targets ]] && return 0
  4. [[ build.xml -nt .ant_targets ]] && return 0
  5. return 1
  6. }
  7. _ant () {
  8. if [[ ! -f build.xml ]]; then
  9. return
  10. fi
  11. if ! _ant_does_target_list_need_generating; then
  12. return
  13. fi
  14. ant -p | awk -F " " 'NR > 5 { print lastTarget } { lastTarget = $1 }' >| .ant_targets
  15. compadd -- "$(cat .ant_targets)"
  16. }
  17. _ant "$@"