|
Server : Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 System : Linux server.jackjohnson.com 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64 User : jackjohn ( 502) PHP Version : 5.3.17 Disable Function : NONE Directory : /usr/share/zsh/4.3.10/functions/ |
Upload File : |
#autoload
local opt OPTARG
local term=$'\0'
while getopts "t:" opt; do
case $opt in
(t)
term=$OPTARG
;;
(*)
return 1
;;
esac
done
shift $(( OPTIND - 1 ))
local tag=$1
local desc=$2
shift 2
reply=(\()
integer i
local -a wds
for (( i = 1; i <= $#; i++ )); do
wds=(${(s.:.)argv[i]})
reply+=(/${wds[1]//\**/"[^$term]#"}"$term"/)
if [[ $term = $'\0' ]]; then
reply+=(":${tag}:${desc}:(( ${wds[1]//\*}:${wds[2]//(#m)[: \(\)]/\\$MATCH} ))")
else
reply+=(":${tag}:${desc}:_values -s ${(q)term} ${(q)desc} \
${(q)${${wds[1]//\*}//(#m)[:\[\]]/\\$MATCH}}\\[${(q)${wds[2]//(#m)[:\[\]]/\\$MATCH}}\\]")
fi
eval "reply+=($wds[3])"
if (( $i == $# )); then
reply+=(\))
else
reply+=(\|)
fi
done