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

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

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

# It can still happen that there is a precommand command or builtin in the line.
# In such cases, the variant has to be modified suitably, after further checking
# the variant of the _command_ mkdir.
# 
# $precommands is defined in _main_complete
if (( ${+precommands[(r)command]} )); then
  _mkdir_command () { command mkdir "$@" }
  _pick_variant -c _mkdir_command -r variant gnu=gnu unix --help
  unfunction _mkdir_command
elif (( ${+precommands[(r)builtin]} )) || (( ${+builtins[mkdir]} )) || [[ "$(type -w mkdir)" == "*: builtin" ]]; then
  variant=zsh
else
  _pick_variant -r variant gnu=gnu zsh='\(eval\)' $OSTYPE --help
fi
# Now $variant is set.

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

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

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

return ret
debug log:

solving 7e8ff121a ...
found 7e8ff121a in https://inbox.vuxu.org/zsh-workers/20170829022810.485-2-danielsh@tarpaulin.shahaf.local2/
found b104d3d60 in https://inbox.vuxu.org/zsh-workers/20170829022810.485-1-danielsh@tarpaulin.shahaf.local2/
found f2299f7c7 in https://git.vuxu.org/mirror/zsh/
preparing index
index prepared:
100644 f2299f7c7c0945911c6edf85e65fc02702c19896	Completion/Unix/Command/_mkdir

applying [1/2] https://inbox.vuxu.org/zsh-workers/20170829022810.485-1-danielsh@tarpaulin.shahaf.local2/
diff --git a/Completion/Unix/Command/_mkdir b/Completion/Unix/Command/_mkdir
index f2299f7c7..b104d3d60 100644


applying [2/2] https://inbox.vuxu.org/zsh-workers/20170829022810.485-2-danielsh@tarpaulin.shahaf.local2/
diff --git a/Completion/Unix/Command/_mkdir b/Completion/Unix/Command/_mkdir
index b104d3d60..7e8ff121a 100644

Checking patch Completion/Unix/Command/_mkdir...
Applied patch Completion/Unix/Command/_mkdir cleanly.
1:59: trailing whitespace.
# 
Checking patch Completion/Unix/Command/_mkdir...
Applied patch Completion/Unix/Command/_mkdir cleanly.
warning: 1 line adds whitespace errors.

index at:
100644 7e8ff121a593a6e46f56f8ca852855a57ac520da	Completion/Unix/Command/_mkdir

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