zsh-workers
 help / color / mirror / code / Atom feed
0ae6be14b73f9866d22e5725539961d929e43e06 blob 1131 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
 
#compdef mkdir gmkdir zf_mkdir

local curcontext="$curcontext" variant ret=1
local -a state line expl args aopts=( -A '-*' )
typeset -A opt_args

args=(
  '(-m --mode)'{-m,--mode=}'[set permission mode]: :_file_modes'
  '(-p --parents)'{-p,--parents}'[make parent directories as needed]'
  '*: :->directories'
)

_pick_variant -r variant -b zsh gnu=gnu $OSTYPE --help

case $variant in
  gnu|freebsd*|dragonfly*|darwin*)
    args+=(
      '(-v --verbose)'{-v,--verbose}'[print message for each created directory]'
    )
  ;|
  gnu)
    aopts=()
    if [[ $OSTYPE == linux* ]]; then
      args+=(
        '(-Z --context)'{-Z,--context=}'[set SELinux context]:SELinux context'
      )
    fi
    args+=(
      '(- :)--help[display help information]'
      '(- :)--version[display version information]'
    )
  ;;
  *) # non-GNU: remove long options
    args=( ${${${args:#(|*\))--*}//--[^ )]#/}/\( #\)/} )
  ;;
esac

_arguments -C -s -S $aopts $args && ret=0

case "$state" in
  directories)
    _wanted directories expl \
      'parent directory or name of directory to create' \
      _path_files -/ && ret=0
  ;;
esac

return ret
debug log:

solving 0ae6be14b ...
found 0ae6be14b 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).