#compdef rage-mount

autoload -U is-at-least

_rage-mount() {
    typeset -A opt_args
    typeset -a _arguments_options
    local ret=1

    if is-at-least 5.2; then
        _arguments_options=(-s -S -C)
    else
        _arguments_options=(-s -C)
    fi

    local context curcontext="$curcontext" state line
    _arguments "${_arguments_options[@]}" \
'-t+[Indicates the filesystem type (one of "tar", "zip").]:TYPES: ' \
'--types=[Indicates the filesystem type (one of "tar", "zip").]:TYPES: ' \
'--max-work-factor=[Maximum work factor to allow for passphrase decryption.]:WF: ' \
'*-i+[Use the identity file at IDENTITY. May be repeated.]:IDENTITY: ' \
'*--identity=[Use the identity file at IDENTITY. May be repeated.]:IDENTITY: ' \
'-h[Print this help message and exit.]' \
'--help[Print this help message and exit.]' \
'-V[Print version info and exit.]' \
'--version[Print version info and exit.]' \
':filename -- The encrypted filesystem to mount.:' \
':mountpoint -- The directory to mount the filesystem at.:' \
&& ret=0
}

(( $+functions[_rage-mount_commands] )) ||
_rage-mount_commands() {
    local commands; commands=()
    _describe -t commands 'rage-mount commands' commands "$@"
}

if [ "$funcstack[1]" = "_rage-mount" ]; then
    _rage-mount "$@"
else
    compdef _rage-mount rage-mount
fi
