zsh-workers
 help / color / mirror / code / Atom feed
932a7fc895198632bddc100c65c53034c5bb61f7 blob 1464 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 env genv

local context state line variant args ign ret=1

_pick_variant -r variant gnu=Free\ Soft $OSTYPE --version
case $variant in
  gnu)
    (( $#words > 2 )) && ign='!'
    args=(
      '(-)'{-i,--ignore-environment}'[start with empty environment]'
      '(--ignore-environment -i --help --version)*'{-u+,--unset=}'[remove variable from the environment]:env var to remove:_parameters -g "*export*"'
      '(-C --chdir)'{-C+,--chdir=}'[change working directory]:directory:_directories'
      '(-S --split-string)'{-S+,--split-string=}'[perform word splitting]:string to split'
      '(-v --debug)'{-v,--debug}'[print verbose information for each processing step]'
      "${ign}(- *)--help[display help information]"
      "${ign}(- *)--version[display version information]"
    )
  ;;
  freebsd*|darwin*)
    args=(
      '(-i)*-u+[remove variable from the environment]:env var to remove:_parameters -g "*export*"'
      '-P+[specify alternate executable search PATH]:path:_dir_list'
      '-S+[perform word splitting]:string to split'
      '*-v[verbose output]'
    )
  ;&
  *)
    if (( $words[(i)-] < CURRENT )); then
      words[(i)-]=()
      (( CURRENT-- ))
    else
      args+=(
	'(-i)'{-,-i}'[start with empty environment]'
      )
    fi
  ;;
esac

_arguments $args \
  '*::arguments:->normal' && ret=0

if [[ -n $state ]]; then
  while [[ $words[1] = *=* ]]; do
    shift words
    (( CURRENT-- ))
  done
  _normal && ret=0
fi

return ret
debug log:

solving 932a7fc89 ...
found 932a7fc89 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).