Consider macOS's uuidgen

This commit is contained in:
Shohei YOSHIDA 2024-11-14 18:10:40 +09:00
parent 8f3baa3b1e
commit 2c2d87889a
1 changed files with 19 additions and 11 deletions

View File

@ -34,17 +34,25 @@
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_arguments \ case $OSTYPE in
'(- *)'{-h,--help}'[display this help]' \ (darwin*)
'(- *)'{-V,--version}'[display version]' \ _arguments \
'(-r --random)'{-r,--random}'[generate random-based uuid]' \ '-hdr[emit result in form suitable for copying into a header]'
'(-t --time)'{-t,--time}'[generate time-based uuid]' \ ;;
'(-n --namespace)'{-n,--namespace}'[generate hash-based uuid in this namespace]:namespace:(@dns @url @oid @x500)' \ (*)
'(-N --name)'{-n,--name}'[generate hash-based uuid from this name]:name' \ _arguments \
'(-C --count -s --sha1 -m --md5)'{-m,--md5}'[generate md5 hash]' \ '(- *)'{-h,--help}'[display this help]' \
'(-C --count -s --sha1 -m --md5)'{-C,--count}'[generate more uuids in loop]:count' \ '(- *)'{-V,--version}'[display version]' \
'(-C --count -s --sha1 -m --md5)'{-s,--sha1}'[generate sha1 hash]' \ '(-r --random)'{-r,--random}'[generate random-based uuid]' \
'(-x --hex)'{-h,--hex}'[interpret name as hex string]' '(-t --time)'{-t,--time}'[generate time-based uuid]' \
'(-n --namespace)'{-n,--namespace}'[generate hash-based uuid in this namespace]:namespace:(@dns @url @oid @x500)' \
'(-N --name)'{-n,--name}'[generate hash-based uuid from this name]:name' \
'(-C --count -s --sha1 -m --md5)'{-m,--md5}'[generate md5 hash]' \
'(-C --count -s --sha1 -m --md5)'{-C,--count}'[generate more uuids in loop]:count' \
'(-C --count -s --sha1 -m --md5)'{-s,--sha1}'[generate sha1 hash]' \
'(-x --hex)'{-h,--hex}'[interpret name as hex string]'
;;
esac
# Local Variables: # Local Variables:
# mode: Shell-Script # mode: Shell-Script