diff --git a/bash_completion b/bash_completion index 013499bc..c9aff894 100644 --- a/bash_completion +++ b/bash_completion @@ -2,7 +2,7 @@ # # # @@ -1336,7 +1336,26 @@ _p4() } [ "$have" ] && complete -F _p4 -o default p4 g4 -# +# ant completion is modified from the original submitted by +# Claus-Peter Klas +# +have ant && +_ant_targets() +{ + COMPREPLY=() + local gcmd + + # if we have a partial word to complete, restrict completions to + # matches of that word + [ ! -f build.xml ] && return 0 + + [ -n "$2" ] && gcmd='grep "^$2"' || gcmd=cat + + COMPREPLY=( $( awk 'BEGIN {FS="\""} /\