zsh-workers
 help / color / mirror / code / Atom feed
1240ffbf8b9813a12c91bf43dc427efe9726c907 blob 925 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 
#compdef tcp_open

local curcontext="$curcontext" state line expl
local -A opt_args
local -a argargs sesslist

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'
    '(-a -s -l)-f[open session for accept on 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:_hosts' ':port:_ports' '*:session:->session')
  fi
  _arguments -C $argargs
  ;;
esac

while (( $#state )); do
  case "$state[1]" in
    (sessionlist)
    compset -P '*,'
    ;&

    (session)
    sesslist=(${${${(f)"$(<~/.ztcp_sessions)"}:#[[:space:]]#\#*}/ /:})
    _describe -t sessions 'TCP session' sesslist && return
    ;;

  esac
  shift state
done
debug log:

solving 1240ffb ...
found 1240ffb in https://git.vuxu.org/mirror/zsh/

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).