# 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

    if type _init_completion &>/dev/null; then
        _init_completion -s && split=true
    else
        _split_longopt && split=true
    fi

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

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

    case "${prev}" in
        		!*)
            _filedir so
            return 0
            ;;
        		--auth-id|--output-file|--store-certificate|--store-data|--store-private-key|--store-public-key|--store-secret-key|--update-certificate|-S|-U|-W|-X|-a|-o)
            _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
            ;;
        		--aid|--application-name|--auth-id|--card-profile|--cert-label|--change-attributes|--delete-objects|--erase-application|--generate-key|--key-usage|--label|--md-container-guid|--output-file|--passphrase|--pin|--profile|--public-key-label|--puk|--puk-id|--puk-label|--reader|--secret-key-algorithm|--serial|--so-pin|--so-puk|--store-certificate|--store-data|--store-private-key|--store-public-key|--store-secret-key|--update-certificate|--user-consent|-A|-D|-G|-S|-U|-W|-X|-a|-c|-o|-p|-r|-u)
            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
