zsh-workers
 help / color / mirror / code / Atom feed
207e5cf78aae2541fd0bf6ff7fb1de4ec318cc82 blob 977 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
 
#autoload

# This should be used to complete parameter names if you need some of the
# extra options of compadd. It completes only non-local parameters.

# If you specify a -g option with a pattern, the pattern will be used to
# restrict the type of parameters matched.

local expl pattern fakes faked tmp i pfilt

if compset -P '*:'; then
  _history_modifiers p
  return
fi

pattern=(-g \*)
zparseopts -D -K -E g:=pattern

fakes=()
faked=()
if zstyle -a ":completion:${curcontext}:" fake-parameters tmp; then
  for i in "$tmp[@]"; do
    if [[ "$i" = *:* ]]; then
      faked=( "$faked[@]" "$i" )
    else
      fakes=( "$fakes[@]" "$i" )
    fi
  done
fi

zstyle -t ":completion:${curcontext}:parameters" prefix-needed && \
 [[ $PREFIX != [_.]* ]] && \
 pfilt='[^_.]'

_wanted parameters expl parameter \
    compadd "$@" -Q - \
        "${(@M)${(@k)parameters[(R)${pattern[2]}~*local*]}:#${~pfilt}*}" \
        "$fakes[@]" \
        "${(@)${(@M)faked:#${~pattern[2]}}%%:*}"
debug log:

solving 207e5cf78 ...
found 207e5cf78 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).