#!/bin/bash _gradle_complete() { local cur tasks COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} tasks='clean compile dists javadoc jar test war' cur=`echo $cur | sed 's/\\\\//g'` COMPREPLY=($(compgen -W "${tasks}" ${cur} | sed 's/\\\\//g') ) } complete -F _gradle_complete -o filenames gradle