#autoload local all get val i # Should we return the value? if [[ "$1" = -g ]]; then get=yes shift fi # Get all styles defined for this context. all=() for i in "${(s.:.)_cur_contexts}"; do all=("$all[@]" "${(@)_compstyles[(K)${i},${1}]}" ) done all=":${(j.:.)${(@o)all:#}##??}:" if [[ "$all" = *:${2}[:\=]* ]]; then # We have a definition for the style. if [[ $# -eq 3 ]]; then if [[ -n "$get" ]]; then # We have to return the value. if [[ "$all" = *,${2}\=* ]]; then eval "${3}=\"${${all#*:${2}\=}%%:*}\"" else eval "${3}=''" fi else # We have to test the value. if [[ "$all" = *:${2}\=* ]]; then [[ "${${all#*:${2}\=}%%:*}" = ${~3} ]] else [[ '' -eq ${~3} ]] fi return fi fi return 0 fi return 1