_ripdvd()
{
	local cur

	COMPREPLY=()
	cur=${COMP_WORDS[COMP_CWORD]}
	prev=${COMP_WORDS[COMP_CWORD-1]}

	case "$prev" in
		--dest-dir)
			_filedir -d
			return 0
			;;
		--dvd-dev)
			_filedir
			return 0
			;;
		--acodec)
			COMPREPLY=( $( compgen -W 'aac ac3 flac mp3' -- $cur ) )
			return 0
			;;
		--vcodec)
			COMPREPLY=( $( compgen -W 'x264 xvid' -- $cur ) )
			return 0
			;;
	esac

	if [[ "$cur" == -* ]]; then
		COMPREPLY=( $( compgen -W '-c -h -r -s -t -v \
		--configure --help --re-read --scan --test --version \
		--automatic \
		--abtr --acodec --aid --alang --aspect --autocrop --cartoon --chapter --crop \
		--deinterlace --dest-dir --dvd-dev --no-eject --no-preview --print-cmd --second-audio \
		--sfile --sid --size --skip --skip-one --slang --split --title --track --two-pass \
		--vbtr --vcodec --width' -- $cur ) )
	fi

}
complete -F _ripdvd ripdvd

