Merge pull request #1305 from felix-windsor/codex/diskutil-completion

diskutil: fix disk image creation options and formats
This commit is contained in:
Shohei YOSHIDA authored and GitHub committed 2026-12-04 18:39:23 +09:00
commit b5956035a7
1 file changed
+14 -5
+14 -5
View File
@@ -582,6 +582,14 @@ _diskutil_image_subcommands() {
(( $+functions[_diskutil_image_create] )) ||
_diskutil_image_create() {
local ret=1
local -a common_options=(
'(-e --encrypt)'{-e,--encrypt}'[encrypt the disk image]'
'(-v --verbose)'{-v,--verbose}'[enable verbose output]'
'(--stdinpass --stdinpassphrase)'{--stdinpass,--stdinpassphrase}'[read the passphrase from stdin]'
'--plist[produce output in a plist format]'
'(--volname --volumeName)'{--volname,--volumeName}'[specify the volume name]:volume name:'
'(- *)'{-h,--help}'[show help]'
)
_arguments -C \
'1: :_diskutil_image_create_subcommands' \
@@ -593,16 +601,17 @@ _diskutil_image_create() {
case $words[1] in
(blank)
_arguments \
'--format[disk format]:format:(RAW ASIF USDB)' \
'--size[disk size]:size' \
'--volumeName[volume name]:name' \
'-fs[create a file system in the specified format]:format:(APFS ExFAT MS-DOS)' \
"${common_options[@]}" \
'(-f --format)'{-f,--format}'[disk format]:format:(RAW ASIF UDSB)' \
'(-s --size)'{-s,--size}'[disk size]:size:' \
'--fs[create a file system in the specified format]:format:(APFS ExFAT MS-DOS None)' \
'*:: :_files' \
&& ret=0
;;
(from)
_arguments \
'--format[disk format]:format:(RAW UDRO UDZO ULFO ULMO ASIF UDSB)' \
"${common_options[@]}" \
'(-f --format)'{-f,--format}'[disk format]:format:(RAW UDRO UDZO ULFO ULMO ASIF UDSB)' \
'--shadow[path to the shadow file]:path:_files' \
'*:: :_files' \
&& ret=0