# bash completion for spring
# Installation: source this file locally in a terminal or from
# ~/.bashrc or put it in /etc/bash_completions.d (debian)

_spring()
{
	local cur prev help helps words cword command commands i

	_get_comp_words_by_ref cur prev words cword

	COMPREPLY=()

	while read -r line; do
		reply=`echo "$line" | awk '{print $1;}'`
		COMPREPLY+=("$reply")
	done < <(spring hint ${cword} ${words[*]})

	if [ $cword -ne 1 ]; then
		_filedir
	fi

} && complete -F _spring spring
