#compdef ydcv
# --------------------------------------------------------------------
# Description
# --------------------------------------------------------------------
#
# Completion script for ydcv (https://github.com/felixonmars/ydcv)
#
# --------------------------------------------------------------------
# Authors
# --------------------------------------------------------------------
#
# Fernando "Firef0x" G.P. da Silva <firefgx { aT ) gmail [ d0t } com>
#
# --------------------------------------------------------------------
# Install
# --------------------------------------------------------------------
#
# Copy this file to /usr/share/zsh/site-functions/_ydcv
#
# --------------------------------------------------------------------

# options for passing to _arguments: main ydcv commands
ydcv_opts_commands=(
    '(-f --full)'{-f,--full}'[print full web reference, only the first 3 results will be printed without this flag.]'
    '(-h --help)'{-h,--help}'[show this help message and exit]'
    '--color[colorize the output. Default to "auto" or can be "never" or "always".]'
    '(-s --simple)'{-s,--simple}'[only show explainations. argument "-f" will not take effect]'
    '(-x --selection)'{-x,--selection}'[show explaination of current selection.]'
)

case "${words[CURRENT - 1]}" in
	"--color")
		coloropts=(auto always never)
		compadd $coloropts
		;;
	*)
		_arguments $ydcv_opts_commands
		;;
esac
