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

local output cmd pat
local -a builtin_precommands var
local -A opts

builtin_precommands=(- builtin eval exec nocorrect noglob time)

(( $+_cmd_variant )) || typeset -gA _cmd_variant

zparseopts -D -A opts b: c: r:
: ${opts[-c]:=$words[1]}

while [[ $1 = *=* ]]; do
  var+=( "${1%%\=*}" "${1#*=}" )
  shift
done

if (( $+opts[-b] && ! ${#precommands:|builtin_precommands} &&
    ( $+builtins[$opts[-c]] || $precommands[(I)builtin] ) )); then
  (( $+opts[-r] )) && eval "${opts[-r]}=$opts[-b]"
  return 0
fi

if (( $+_cmd_variant[$opts[-c]] )); then
  (( $+opts[-r] )) && eval "${opts[-r]}=${_cmd_variant[$opts[-c]]}"
  [[ $_cmd_variant[$opts[-c]] = "$1" ]] && return 1
  return 0
fi

output="$(_call_program variant $opts[-c] "${@[2,-1]}" </dev/null 2>&1)"

for cmd pat in "$var[@]"; do
  if [[ $output = *$~pat* ]]; then
    (( $+opts[-r] )) && eval "${opts[-r]}=$cmd"
    _cmd_variant[$opts[-c]]="$cmd"
    return 0
  fi
done

(( $+opts[-r] )) && eval "${opts[-r]}=$1"
_cmd_variant[$opts[-c]]="$1"

return 1
debug log:

solving f4ceb7462 ...
found f4ceb7462 in https://inbox.vuxu.org/zsh-workers/20190320020511.GA6739@CptOrmolo.darkstar/
found 9099e3599 in https://git.vuxu.org/mirror/zsh/
preparing index
index prepared:
100644 9099e359987dc90451c2114f3dd7a699e914905f	Completion/Base/Utility/_pick_variant

applying [1/1] https://inbox.vuxu.org/zsh-workers/20190320020511.GA6739@CptOrmolo.darkstar/
diff --git a/Completion/Base/Utility/_pick_variant b/Completion/Base/Utility/_pick_variant
index 9099e3599..f4ceb7462 100644

Checking patch Completion/Base/Utility/_pick_variant...
Applied patch Completion/Base/Utility/_pick_variant cleanly.

index at:
100644 f4ceb7462b1a5779dd079442d6ecf9998b484602	Completion/Base/Utility/_pick_variant

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).