zsh-workers
 help / color / mirror / code / Atom feed
22372ab36b49df88259078b975bbadef6b15e9b2 blob 1638 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
50
 
#compdef -value- -array-value- -value-,-default-,-default-

# You can customize completion for different parameters by writing
# functions with the tag-line `#compdef -value-,<name>,<command>' where
# <name> is the name of the parameter (or name-key when completing an
# associative array value) and <command> is either `-default-' or the
# name of the command from the command-line.

if [[ "$service" != -value-,* ]]; then
  local strs ctx=

  strs=( -default- )

  if [[ "$compstate[context]" != *value && -n "$_comp_command1" ]]; then
    ctx="${_comp_command}"
    strs=( "${_comp_command1}" "$strs[@]" )
    [[ -n "$_comp_command2" ]] &&
        strs=( "${_comp_command2}" "$strs[@]" )
  fi

  _dispatch -value-,${compstate[parameter]},$ctx \
            -value-,{${compstate[parameter]},-default-},${^strs}
else
  if [[ "$compstate[parameter]" != *-* &&
        "$compstate[context]" = *value &&
        "${(Pt)${compstate[parameter]}}" = assoc* ]]; then
    local expl
    if (( CURRENT & 1 )); then
      _wanted association-keys expl 'association key' \
          compadd -k "$compstate[parameter]"
    else
      compstate[parameter]="${compstate[parameter]}-${words[CURRENT-1]}"

      _dispatch -value-,${compstate[parameter]}, \
                -value-,{${compstate[parameter]},-default-},-default-
    fi
  else
    local pats

    if { zstyle -a ":completion:${curcontext}:" assign-list pats &&
         [[ "$compstate[parameter]" = (${(j:|:)~pats}) ]] } ||
       [[ "$PREFIX$SUFFIX" = *:* ]]; then
      compset -P '*:'
      compset -S ':*'
      _default -r '\-\n\t /:' "$@"
    else
      _default "$@"
    fi
  fi
fi
debug log:

solving 22372ab36 ...
found 22372ab36 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).