# this was auto-generated by OpenSC/doc/tools/Makefile.am
_pkcs11_tool()
{
    COMPREPLY=()
    local cur prev split=false
    _get_comp_words_by_ref cur prev

    _split_longopt && split=true

    opts="		--attr-from --change-pin --decrypt --hash --id --init-pin --init-token --input-file --keypairgen --label --list-mechanisms --list-objects --list-slots --list-token-slots --login --mechanism --module --moz-cert --output-file --pin --set-id --show-info --sign --slot --slot-description --slot-index --so-pin --test --token-label --type --verbose --write-object -I -L -M -O -T -a -c -d -e -h -i -k -l -m -o -p -s -t -w -y -z "

    if [ ${COMP_CWORD} -eq 1 ]; then
        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
        return 0
    fi

    case "${prev}" in
        		--attr-from|--id|--input-file|--label|--mechanism|--module|--moz-cert|--output-file|--pin|--set-id|--slot|--slot-description|--slot-index|--so-pin|--token-label|--type|--write-object|-a|-d|-e|-i|-m|-o|-p|-w|-y|-z)
            return 0
            ;;
        *)
            COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
            return 0
            ;;
    esac

    $split && return 0

    if [[ "$cur" == -* ]]; then
        _longopt $1
        return
    fi

    _filedir
}
complete -F _pkcs11_tool pkcs11-tool


# Local variables:
# mode: shell-script
# sh-basic-offset: 4
# sh-indent-comment: t
# indent-tabs-mode: nil
# End:
# ex: ts=4 sw=4 et filetype=sh
