2000-04-01 22:43:43 +02:00
|
|
|
#autoload
|
|
|
|
|
2000-04-25 13:00:06 +02:00
|
|
|
local gopt=-J len tmp pre suf ret=1 descr spec prev
|
|
|
|
|
|
|
|
if [[ "$1" = - ]]; then
|
|
|
|
prev=-
|
|
|
|
shift
|
|
|
|
fi
|
2000-04-01 22:43:43 +02:00
|
|
|
|
|
|
|
if [[ "$1" = -([12]|)[VJ] ]]; then
|
|
|
|
gopt="$1"
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
|
|
|
|
tmp=${argv[(ib:4:)-]}
|
|
|
|
len=$#
|
|
|
|
if [[ tmp -lt len ]]; then
|
|
|
|
pre=$(( tmp-1 ))
|
|
|
|
suf=$tmp
|
|
|
|
elif [[ tmp -eq $# ]]; then
|
|
|
|
pre=-2
|
|
|
|
suf=$(( len+1 ))
|
|
|
|
else
|
|
|
|
pre=4
|
|
|
|
suf=5
|
|
|
|
fi
|
|
|
|
|
2000-04-25 13:00:06 +02:00
|
|
|
while comptags "-A$prev" "$1" curtag spec; do
|
2000-04-11 09:57:56 +02:00
|
|
|
_comp_tags="$_comp_tags $spec "
|
|
|
|
if [[ "$curtag" = *:* ]]; then
|
|
|
|
zformat -f descr "${curtag#*:}" "d:$3"
|
|
|
|
_description "$gopt" "${curtag%:*}" "$2" "$descr"
|
|
|
|
curtag="${curtag%:*}"
|
2000-04-01 22:43:43 +02:00
|
|
|
|
2000-05-08 10:16:32 +02:00
|
|
|
"$4" "${(P@)2}" "${(@)argv[5,-1]}" && ret=0
|
2000-04-11 09:57:56 +02:00
|
|
|
else
|
|
|
|
_description "$gopt" "$curtag" "$2" "$3"
|
2000-04-01 22:43:43 +02:00
|
|
|
|
2000-04-11 09:57:56 +02:00
|
|
|
"${(@)argv[4,pre]}" "${(P@)2}" "${(@)argv[suf,-1]}" && ret=0
|
|
|
|
fi
|
2000-04-01 22:43:43 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
return ret
|