_pgp-sig2dot() {
    local i cur prev opts cmd
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"
    cmd=""
    opts=""

    for i in ${COMP_WORDS[@]}
    do
        case "${cmd},${i}" in
            ",$1")
                cmd="pgp__sig2dot"
                ;;
            pgp__sig2dot,gen)
                cmd="pgp__sig2dot__gen"
                ;;
            pgp__sig2dot,help)
                cmd="pgp__sig2dot__help"
                ;;
            pgp__sig2dot__gen,complete)
                cmd="pgp__sig2dot__gen__complete"
                ;;
            pgp__sig2dot__gen,help)
                cmd="pgp__sig2dot__gen__help"
                ;;
            pgp__sig2dot__gen,man)
                cmd="pgp__sig2dot__gen__man"
                ;;
            pgp__sig2dot__gen__help,complete)
                cmd="pgp__sig2dot__gen__help__complete"
                ;;
            pgp__sig2dot__gen__help,help)
                cmd="pgp__sig2dot__gen__help__help"
                ;;
            pgp__sig2dot__gen__help,man)
                cmd="pgp__sig2dot__gen__help__man"
                ;;
            pgp__sig2dot__help,gen)
                cmd="pgp__sig2dot__help__gen"
                ;;
            pgp__sig2dot__help,help)
                cmd="pgp__sig2dot__help__help"
                ;;
            pgp__sig2dot__help__gen,complete)
                cmd="pgp__sig2dot__help__gen__complete"
                ;;
            pgp__sig2dot__help__gen,man)
                cmd="pgp__sig2dot__help__gen__man"
                ;;
            *)
                ;;
        esac
    done

    case "${cmd}" in
        pgp__sig2dot)
            opts="-v -q -k -p -a -h -V --verbose --quiet --import --fingerprint --gossip --show-primary-uid-only --show-self-sigs --online --simple --keyserver --help --version gen help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --import)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --fingerprint)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -k)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --gossip)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --keyserver)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        pgp__sig2dot__gen)
            opts="-v -q -k -p -a -h --verbose --quiet --import --fingerprint --gossip --show-primary-uid-only --show-self-sigs --online --simple --keyserver --help man complete help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --import)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --fingerprint)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -k)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --gossip)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --keyserver)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        pgp__sig2dot__gen__complete)
            opts="-v -q -k -p -a -h --output --verbose --quiet --import --fingerprint --gossip --show-primary-uid-only --show-self-sigs --online --simple --keyserver --help bash elvish fish powershell zsh"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --output)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --import)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --fingerprint)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -k)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --gossip)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --keyserver)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        pgp__sig2dot__gen__help)
            opts="man complete help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        pgp__sig2dot__gen__help__complete)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        pgp__sig2dot__gen__help__help)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        pgp__sig2dot__gen__help__man)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        pgp__sig2dot__gen__man)
            opts="-v -q -k -p -a -h --path --verbose --quiet --import --fingerprint --gossip --show-primary-uid-only --show-self-sigs --online --simple --keyserver --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --path)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --import)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --fingerprint)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -k)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --gossip)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --keyserver)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        pgp__sig2dot__help)
            opts="gen help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        pgp__sig2dot__help__gen)
            opts="man complete"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        pgp__sig2dot__help__gen__complete)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        pgp__sig2dot__help__gen__man)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        pgp__sig2dot__help__help)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
    esac
}

if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then
    complete -F _pgp-sig2dot -o nosort -o bashdefault -o default pgp-sig2dot
else
    complete -F _pgp-sig2dot -o bashdefault -o default pgp-sig2dot
fi
