1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-10 12:40:58 +02:00
zsh/Completion/Core/_style
1999-12-06 11:39:12 +00:00

44 lines
683 B
Text

#autoload
local _val _ret
# Should we return the value?
case "$1" in
-b)
compstyles -S "${curcontext}${2:+:${2}}" "$3" _val
_ret="$?"
if [[ "$_val" = (yes|true|1|on) ]]; then
eval "${4}=yes"
else
eval "${4}=no"
fi
return _ret
;;
-s)
compstyles -S "${curcontext}${2:+:${2}}" "$3" "$4"
return
;;
-a)
compstyles -A "${curcontext}${2:+:${2}}" "$3" "$4"
return
;;
-h)
compstyles -H "${curcontext}${2:+:${2}}" "$3" "$4"
return
;;
esac
[[ "$1" = -(|-) ]] && shift
if compstyles -S "${curcontext}${1:+:${1}}" "$2" _val; then
if [[ $# -eq 3 ]]; then
[[ "$_val" = ${~3} ]]
else
[[ "$_val" = (yes|true|1|on) ]]
fi
else
return 1
fi