2000-04-01 22:43:43 +02:00
|
|
|
#autoload
|
|
|
|
|
2000-05-31 11:38:25 +02:00
|
|
|
local __gopt=-J __len __tmp __pre __suf __ret=1 __descr __spec __prev
|
2000-04-25 13:00:06 +02:00
|
|
|
|
|
|
|
if [[ "$1" = - ]]; then
|
2000-05-31 11:38:25 +02:00
|
|
|
__prev=-
|
2000-04-25 13:00:06 +02:00
|
|
|
shift
|
|
|
|
fi
|
2000-04-01 22:43:43 +02:00
|
|
|
|
|
|
|
if [[ "$1" = -([12]|)[VJ] ]]; then
|
2000-05-31 11:38:25 +02:00
|
|
|
__gopt="$1"
|
2000-04-01 22:43:43 +02:00
|
|
|
shift
|
|
|
|
fi
|
|
|
|
|
2000-05-31 11:38:25 +02:00
|
|
|
__tmp=${argv[(ib:4:)-]}
|
|
|
|
__len=$#
|
|
|
|
if [[ __tmp -lt __len ]]; then
|
|
|
|
__pre=$(( __tmp-1 ))
|
|
|
|
__suf=$__tmp
|
|
|
|
elif [[ __tmp -eq $# ]]; then
|
|
|
|
__pre=-2
|
|
|
|
__suf=$(( __len+1 ))
|
2000-04-01 22:43:43 +02:00
|
|
|
else
|
2000-05-31 11:38:25 +02:00
|
|
|
__pre=4
|
|
|
|
__suf=5
|
2000-04-01 22:43:43 +02:00
|
|
|
fi
|
|
|
|
|
2000-05-31 11:38:25 +02:00
|
|
|
while comptags "-A$__prev" "$1" curtag __spec; do
|
|
|
|
_comp_tags="$_comp_tags $__spec "
|
2000-04-11 09:57:56 +02:00
|
|
|
if [[ "$curtag" = *:* ]]; then
|
2000-05-31 11:38:25 +02:00
|
|
|
zformat -f __descr "${curtag#*:}" "d:$3"
|
|
|
|
_description "$__gopt" "${curtag%:*}" "$2" "$__descr"
|
2000-04-11 09:57:56 +02:00
|
|
|
curtag="${curtag%:*}"
|
2000-04-01 22:43:43 +02:00
|
|
|
|
2000-05-31 11:38:25 +02:00
|
|
|
"$4" "${(P@)2}" "${(@)argv[5,-1]}" && __ret=0
|
2000-04-11 09:57:56 +02:00
|
|
|
else
|
2000-05-31 11:38:25 +02:00
|
|
|
_description "$__gopt" "$curtag" "$2" "$3"
|
2000-04-01 22:43:43 +02:00
|
|
|
|
2000-05-31 11:38:25 +02:00
|
|
|
"${(@)argv[4,__pre]}" "${(P@)2}" "${(@)argv[__suf,-1]}" && __ret=0
|
2000-04-11 09:57:56 +02:00
|
|
|
fi
|
2000-04-01 22:43:43 +02:00
|
|
|
done
|
|
|
|
|
2000-05-31 11:38:25 +02:00
|
|
|
return __ret
|