|
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 : |
#compdef tcp_open
local context line expl nm=$compstate[nmatches]
local -a state argargs sesslist
local -A opt_args
case $service in
(tcp_open)
argargs=(
'(-a -f -l)-s[open session(s)]'
'(-a -f -s)-l[open list of sessions]'
'(-f -s -l)-a[open session for accept on fd]:fd:->fd'
'(-a -s -l)-f[open session for accept on fd]:fd:->fd'
'-q[quiet mode]'
'-z[no zle handler]'
)
if [[ -n $words[(R)-(a|f)*] ]]; then
argargs+=(':session:->session')
elif [[ -n $words[(R)-(l|s)*] ]]; then
argargs+=('*:session:->session')
else
argargs+=(':host:->host' ':port:->port' '*:session:->session')
fi
_arguments -C $argargs
;;
esac
while (( $#state )); do
case "$state[1]" in
(host)
_hosts
;;
(port)
_ports
;;
(sessionlist)
compset -P '*,'
;&
(session)
sesslist=(${${${(f)"$(<~/.ztcp_sessions)"}:#[[:space:]]#\#*}/ /:})
_describe -t sessions 'TCP session' sesslist && return
;;
esac
shift state
done