mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-07-25 21:31:03 +02:00
45 lines
1.2 KiB
Text
45 lines
1.2 KiB
Text
#compdef mktemp gmktemp
|
|
|
|
local variant
|
|
local -a args
|
|
|
|
_pick_variant -r variant busybox=BusyBox gnu='Free Soft' $OSTYPE --version
|
|
|
|
args=(
|
|
'(-d --directory)'{-d,--directory}'[make directory instead of file]'
|
|
'(-q --quiet)'{-q,--quiet}'[suppress error messages]'
|
|
'(-u --dry-run)'{-u,--dry-run}'[print file name only]'
|
|
)
|
|
|
|
case $variant in
|
|
^(dragonfly|darwin)*)
|
|
args+=( '(-p --tmpdir)'{-p+,--tmpdir=}'[make relative to specified directory]: :_directories' )
|
|
;|
|
|
gnu)
|
|
args+=(
|
|
'--suffix=[append specified suffix to template]:template suffix'
|
|
'(: -)'{-V,--version}'[display version information]'
|
|
)
|
|
;|
|
|
# Most variants don't support long options (except BusyBox's --help)
|
|
^(gnu|freebsd*))
|
|
args=( ${args:#((#s)|*\))(\*|)--*} )
|
|
;|
|
|
gnu|*busybox*)
|
|
args+=( '(: -)--help[display help information]' )
|
|
;|
|
|
(gnu|*busybox|openbsd|solaris)*)
|
|
args+=(
|
|
'-t[generate template relative to temp dir]'
|
|
'1: :_guard "^-*" "template name"'
|
|
)
|
|
;;
|
|
(dragonfly|netbsd|freebsd|darwin)*)
|
|
args+=(
|
|
'-t[generate template relative to temp dir using specified prefix]:template prefix'
|
|
'*: :_guard "^-*" "template name"'
|
|
)
|
|
;;
|
|
esac
|
|
|
|
_arguments -s -S : $args
|