zsh-workers
 help / color / mirror / code / Atom feed
4f37c56a30416a0f93ab1748ca3a364055d116fe blob 3311 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
 
#compdef localedef

# TODO: Solaris opts

local curcontext="$curcontext" state line expl ret=1
typeset -A opt_args

if _pick_variant gnu='(GNU|EGLIBC)' unix --version; then

  local exargs="-? --help --usage -V --version"
  _arguments -A "-*" -C -S -s \
    '(- *)'{-\?,--help}'[display help information]' \
    '(- *)--usage[display a short usage message]' \
    '(- *)'{-V,--version}'[print program version]' \
    "(-A --alias-file= $exargs)"{-A+,--alias-file=}'[specify locale alias file]:alias file:_files' \
    "($exargs)--prefix=[specify path prefix]:prefix:_files" \
    "(-c --force $exargs)"{-c,--force}'[force write despite of warnings]' \
    "(-v --verbose $exargs)"{-v,--verbose}'[display additional information]' \
    "($exargs)--quiet[suppress messages and warnings]" \
    - set1 \
    "(-f --charmap= $exargs)"{-f+,--charmap=}'[specify locale charmap file]:charmap:->charmap' \
    "(-i --inputfile= $exargs)"{-i+,--inputfile=}'[specify locale definition file]:locale file:_files' \
    "(-u --repertoire-map= $exargs)"{-u+,--repertoire-map=}'[specify repertoire map file]:repertoire map file:_files' \
    '1:path:_files' \
    - set2 \
    "(--list-archive $exargs)--list-archive[list locales in archive]" \
    - set3 \
    "(--delete-from-archive $exargs)--delete-from-archive[delete locale from archive]" \
    '*:locale:->locale' \
    - set4 \
    "(--add-to-archive $exargs)--add-to-archive[add locale to archive]" \
    "(--replace $exargs)--replace[replace locale in archive]" \
    "(--no-archive $exargs)--no-archive[use subdir not archive]" \
    '*:compiled path:_files -/' \
    && return 0

  case "$state" in
    charmap)
      if [[ $words[-1] == */* ]]; then
        _wanted values expl charmap _files && ret=0
      else
        typeset -a charmaps
        charmaps=( ${(f)"$(locale -m)"} )
        _wanted values expl charmap compadd "$@" \
          -M 'm:{a-zA-Z}={A-Za-z} r:|-=* r:|=*' \
          -a - charmaps && ret=0
      fi
    ;;
    locale)
      typeset -a locales
      local pref=${opt_args[--prefix]}
      local p=${pref:+--prefix}
      locales=( ${(f)"$(localedef --list-archive $p $pref)"} )
      _wanted values expl locale compadd "$@" -a - locales && ret=0
    ;;
  esac

  return ret

else

  typeset -a u_opt dragonfly_opts
  [[ $OSTYPE != darwin* ]] && u_opt=(
      "(-u)"-u+'[specify target codeset]:codeset:_files'
    )
  [[ $OSTYPE == dragonfly* ]] && dragonfly_opts=(
      "(-D)"-D'[create BSD-style output]' \
      "(-U)"-U'[ignore undefined character symbols]' \
      "(-v)"-v'[verbose deguggin output]' \
      "(-w)"-w+'[specify width file]:width file:_files' \
    )

  _arguments -A "-*" -C \
    "(-c)"-c'[force write despite of warnings]' \
    "(-f)"-f+'[specify locale charmap file]:charmap:->charmap' \
    "(-i)"-i+'[specify locale definition file]:locale file:_files' \
    $u_opt \
    $dragonfly_opts \
    '1:path:_files' \
    && return 0

  case "$state" in
    charmap)
      if [[ $words[-1] == */* ]]; then
        _wanted values expl charmap _files && ret=0
      else
        typeset -a charmaps
        charmaps=( ${(f)"$(locale -m)"} )
        _wanted values expl charmap compadd "$@" \
          -M 'm:{a-zA-Z}={A-Za-z} r:|-=* r:|=*' \
          -a - charmaps && ret=0
      fi
    ;;
  esac

  return ret

fi
debug log:

solving 4f37c56 ...
found 4f37c56 in https://inbox.vuxu.org/zsh-workers/574C7A14.6070305@redhat.com/

applying [1/1] https://inbox.vuxu.org/zsh-workers/574C7A14.6070305@redhat.com/
diff --git a/Completion/Unix/Command/_localedef b/Completion/Unix/Command/_localedef
new file mode 100644
index 0000000..4f37c56

Checking patch Completion/Unix/Command/_localedef...
Applied patch Completion/Unix/Command/_localedef cleanly.

index at:
100644 4f37c56a30416a0f93ab1748ca3a364055d116fe	Completion/Unix/Command/_localedef

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