zsh-workers
 help / color / mirror / code / Atom feed
62c2491bb5e936a26c6eaf0ce58f253f725512c1 blob 856 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
42
43
44
45
46
47
48
49
 
#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

if (( $# )); then
  reply=(\()
else
  # ### Is this likely to happen in callers?  Should we warn?
  reply=()
  return
fi

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
debug log:

solving 62c2491bb ...
found 62c2491bb 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).