# this was auto-generated by OpenSC/doc/tools/Makefile.am
_westcos_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="		--certificate --change-pin --finalize --generate-key --help --install-pin --key-length --overwrite-key --pin-value --puk-value --read-file --reader --unblock-pin --verbose --wait --write-file -f -g -h -i -j -k -l -n -o -r -t -u -v -w -x -y "

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

    case "${prev}" in
        		!*)
            _filedir so
            return 0
            ;;
        		--read-file|--write-file|-j|-k)
            _filedir
            return 0
            ;;
        		--pin-value|--puk-value|-x|-y|--password)
            COMPREPLY=( $( compgen -W "$(printenv | cut -d = -f 1 | xargs printf 'env:%s ')" -- $cur ) )
            __ltrim_colon_completions "$cur"
            return 0
            ;;
        		--certificate|--key-length|--pin-value|--puk-value|--read-file|--reader|--write-file|-j|-k|-l|-r|-t|-x|-y)
            return 0
            ;;
        *)
            COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
            return 0
            ;;
    esac

    $split && return 0

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

    _filedir
}
complete -F _westcos_tool westcos-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
