#compdef hdiutil

local expl state line opt_args
typeset -A opt_args

_arguments \
    '(1)1:verb:->verb' \
    '*:options:->options' \
    && return 0

if [[ $state = verb ]]; then
    local verbs
    verbs=(help attach detach eject verify create compact convert burn info load checksum chpass unflatten flatten imageinfo internet-enable makehybrid mount mountvol unmount plugins resize segment pmap)
    _wanted verb expl 'verb' compadd "$@" $verbs && return 0
fi

if [[ $state = options ]]; then
    case $line[1] in
	eject | detach)
	    if [[ $#line == 2 ]]; then
		local devices
		devices=(`df|grep '^/'|awk '{print $1 ":" $6}'`)
		_describe 'device' devices -- && return 0
	    fi ;;
    esac
fi

return 1

# Local Variables:
# mode: sh
# End: