#compdef eix-installed-after
local curcontext="$curcontext" state state_descr line expl
typeset -A opt_args
_arguments -C -s -S -A '-*' : \
'(1 -)'{'-h','-\\?'}'[help]' \
'-I[include the given package in the output]' \
'(1 -b -L -l -a -A -I -e -F -S -V)-f[output full list of packages]' \
'(-f -L -e -F)-l[use /var/log/emerge.log to determine first install time]' \
'(-f -l -e -F)-L+[LOG (use LOG to determine first install time)]:scan logfile:_files' \
'(-f -l -L -F)-e+[TIME (use TIME as reference time)]:seconds since epoch: ' \
'(-f -l -L -e)-F+[FILE (use mtime as reference time)]:file for mtime:_files' \
'-a+[SEC (increase match for -l or -L or -e by SEC seconds)]:increase seconds: ' \
'-A+[SEC (decrease match for -l or -L or -e by SEC seconds)]:decrease seconds: ' \
'-b[output packages installed before (not after) the package]' \
'-i[ignore all previous options]' \
'-S[choose first matching slot]' \
'-V[look for category/package-version, not category/package\:slot]' \
'-d[output installation date after package]' \
'-s[output slot also in case of no ambiguity]' \
'-v[output category/package-version, not category/package\:slot]' \
'-\=[output \=category/package-version, not category/package\:slot]' \
'-t[use build time independent of USE_BUILD_TIME]' \
'-T[never use build time independent of USE_BUILD_TIME]' \
'1:package:->package'
local ret=$?
case $state in
(package)
	_tags packages
	_tags && {
		local d
		local -x NEWLINE=false CAREMODE=false QUICKMODE=true \
			FORCE_COLORS=false RESTRICT_INSTALLED=false \
			USE_BUILD_TIME=false DEFAULT_FORMAT=normal \
			FORMAT='<installedversions:I>' I
		if [[ -n ${opt_args[-l]++} || -n ${opt_args[-L]++} || -n ${opt_args[-V]++} ]]
		then	_description packages expl 'category/package-version'
			I='-<version>'
		else	_description packages expl 'category/package[:slot]'
			I='{slots}:<slot>{}'
		fi
		I='<category>/<name>'"$I"'\n'
		compadd "$expl[@]" - $(_call_program packages-installed 'eix --pure-packages -I 2>/dev/null')
	} && ret=0;;
esac
return ret
