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

    _split_longopt && split=true

    opts="		-A --aid --application-id --application-name --authority -c -C --card-profile --cert-label --change-attributes --create-pkcs15 -D --delete-objects -E --erase-application --erase-card --extractable -F --finalize --format -G --generate-key -h --help --id --ignore-ca-certificates --insecure --key-usage --label --md-container-guid --no-so-pin -o --output-file -p -P --passphrase --pin --profile --public-key-label --puk --puk-id --puk-label -r --reader -S --sanity-check --secret-key-algorithm --serial --so-pin --so-puk --store-certificate --store-data --store-data-object --store-pin --store-private-key --store-public-key --store-secret-key -T -u -U --update-certificate --update-existing --update-last-update --use-default-transport-keys --use-pinpad --user-consent -v --verbose --verify-pin --version -w -W --wait -X "

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

    case "${prev}" in
        		!*)
            _filedir so
            return 0
            ;;
        		-o|--output-file|-S|--store-certificate|--store-data|--store-private-key|--store-public-key|--store-secret-key|-U|--update-certificate|-W|-X)
            _filedir
            return 0
            ;;
        		--pin|--puk|--so-pin|--so-puk|--password)
            COMPREPLY=( $( compgen -W "$(printenv | cut -d = -f 1 | xargs printf 'env:%s ')" -- $cur ) )
            __ltrim_colon_completions "$cur"
            return 0
            ;;
        		-A|--aid|--application-name|-c|--card-profile|--cert-label|--change-attributes|-D|--delete-objects|--erase-application|-G|--generate-key|--key-usage|--md-container-guid|-o|--output-file|-p|--passphrase|--pin|--profile|--public-key-label|--puk|--puk-id|--puk-label|-r|--reader|-S|--secret-key-algorithm|--serial|--so-pin|--so-puk|--store-certificate|--store-data|--store-private-key|--store-public-key|--store-secret-key|-u|-U|--update-certificate|--user-consent|-W|-X)
            return 0
            ;;
        *)
            COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
            return 0
            ;;
    esac

    $split && return 0

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

    _filedir
}
complete -F _pkcs15_init pkcs15-init


# 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
