# bash completion for ant and phing -*- shell-script -*- _ant_parse_targets() { local line basedir [[ $1 == */* ]] && basedir=${1%/*} || basedir=. # parse buildfile for targets while read -rd '>' line; do if [[ $line =~ \<(target|extension-point)[[:space:]].*name=[\"\']([^\"\']+) ]]; then targets+=" ${BASH_REMATCH[2]}" fi done <$1 # parse imports while read -rd '>' line; do if [[ $line =~ \/dev/null && complete -C complete-ant-cmd.pl -F _ant ant || : # ex: filetype=sh