#compdef look local context state line typeset -A opt_args _arguments -s \ '-t+[termination character]:termination character:' \ '-f[case insensitive]' \ '-d[dictionary order]' \ ':string:->string' case "$state" in string) if [[ -n "$PREFIX" ]]; then compadd - $(_call values $words[1] $PREFIX) fi ;; esac