# this was auto-generated by OpenSC/doc/tools/Makefile.am
_npa_tool()
{
    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="		--application --auxiliary-data --break --can --cert-desc --chat --cv-certificate --cvc-dir --disable-all-checks --disable-ca-checks --disable-ta-checks --env --help --mrz --new-pin --older-than --pin --private-key --puk --read-all-dgs --read-dg1 --read-dg10 --read-dg11 --read-dg12 --read-dg13 --read-dg14 --read-dg15 --read-dg16 --read-dg17 --read-dg18 --read-dg19 --read-dg2 --read-dg20 --read-dg21 --read-dg3 --read-dg4 --read-dg5 --read-dg6 --read-dg7 --read-dg8 --read-dg9 --reader --resume --tr-03110v201 --translate --unblock --verbose --verify-community --verify-validity --version --write-dg17 --write-dg18 --write-dg19 --write-dg20 --write-dg21 --x509-dir -A -C -N -P -R -U -V -b -c -h -m -p -r -t -u -v "

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

    case "${prev}" in
        		!*)
            _filedir so
            return 0
            ;;
        		!*)
            _filedir
            return 0
            ;;
        		!*|--password)
            COMPREPLY=( $( compgen -W "$(printenv | cut -d = -f 1 | xargs printf 'env:%s ')" -- $cur ) )
            __ltrim_colon_completions "$cur"
            return 0
            ;;
        		--application|--auxiliary-data|--can|--cert-desc|--chat|--cv-certificate|--cvc-dir|--mrz|--new-pin|--older-than|--pin|--private-key|--puk|--reader|--translate|--verify-community|--verify-validity|--write-dg17|--write-dg18|--write-dg19|--write-dg20|--write-dg21|--x509-dir|-A|-C|-N|-P|-c|-m|-p|-r|-t|-u)
            return 0
            ;;
        *)
            COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
            return 0
            ;;
    esac

    $split && return 0

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

    _filedir
}
complete -F _npa_tool npa-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
