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

    _split_longopt && split=true

    opts="		--bio-server1 --bio-server2 -C --create-dkek-share --dkek-shares -e --export-for-pub-key-auth --force -g -I --import-dkek-share --initialize -K --key-reference -l --label -n --password --pin --pin-retry --public-key-auth --public-key-auth-status --pwd-shares-threshold --pwd-shares-total -r --reader --register-public-key --required-pub-keys -s -S --so-pin -U --unwrap-key -v --verbose -w -W --wait --wrap-key -X "

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

    case "${prev}" in
        		!*)
            _filedir so
            return 0
            ;;
        		-C|--create-dkek-share|-I|--import-dkek-share|-U|--unwrap-key|-W|--wrap-key)
            _filedir
            return 0
            ;;
        		--pin|--so-pin|--password)
            COMPREPLY=( $( compgen -W "$(printenv | cut -d = -f 1 | xargs printf 'env:%s ')" -- $cur ) )
            __ltrim_colon_completions "$cur"
            return 0
            ;;
        		--bio-server1|--bio-server2|-C|--create-dkek-share|--dkek-shares|-e|--export-for-pub-key-auth|-g|-I|--import-dkek-share|-K|-l|--label|-n|--password|--pin|--pin-retry|--public-key-auth|--pwd-shares-threshold|--pwd-shares-total|-r|--reader|--register-public-key|--required-pub-keys|-s|--so-pin|-U|--unwrap-key|-W|--wrap-key)
            return 0
            ;;
        *)
            COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
            return 0
            ;;
    esac

    $split && return 0

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

    _filedir
}
complete -F _sc_hsm_tool sc-hsm-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
