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

    for i in ${COMP_WORDS[@]}
    do
        case "${i}" in
            sqop)
                cmd="sqop"
                ;;
            
            armor)
                cmd+="__armor"
                ;;
            dearmor)
                cmd+="__dearmor"
                ;;
            decrypt)
                cmd+="__decrypt"
                ;;
            encrypt)
                cmd+="__encrypt"
                ;;
            extract-cert)
                cmd+="__extract__cert"
                ;;
            generate-key)
                cmd+="__generate__key"
                ;;
            help)
                cmd+="__help"
                ;;
            sign)
                cmd+="__sign"
                ;;
            verify)
                cmd+="__verify"
                ;;
            version)
                cmd+="__version"
                ;;
            *)
                ;;
        esac
    done

    case "${cmd}" in
        sqop)
            opts=" -h  --help   version generate-key extract-cert sign verify encrypt decrypt armor dearmor help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        
        sqop__armor)
            opts=" -h -V  --help --version --label  "
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                
                --label)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        sqop__dearmor)
            opts=" -h -V  --help --version  "
            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
            ;;
        sqop__decrypt)
            opts=" -h -V  --help --version --session-key-out --with-session-key --with-password --verify-out --verify-with --verify-not-before --verify-not-after  <keys>... "
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                
                --session-key-out)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --with-session-key)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --with-password)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --verify-out)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --verify-with)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --verify-not-before)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --verify-not-after)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        sqop__encrypt)
            opts=" -h -V  --no-armor --help --version --as --with-password --sign-with  <certs>... "
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                
                --as)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --with-password)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --sign-with)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        sqop__extract__cert)
            opts=" -h -V  --no-armor --help --version  "
            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
            ;;
        sqop__generate__key)
            opts=" -h -V  --no-armor --help --version  <userids>... "
            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
            ;;
        sqop__help)
            opts=" -h -V  --help --version  "
            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
            ;;
        sqop__sign)
            opts=" -h -V  --no-armor --help --version --as --micalg-out  <keys>... "
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                
                --as)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --micalg-out)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        sqop__verify)
            opts=" -h -V  --help --version --not-before --not-after  <signatures> <certs>... "
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                
                --not-before)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --not-after)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        sqop__version)
            opts=" -h -V  --backend --extended --help --version  "
            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
            ;;
    esac
}

complete -F _sqop -o bashdefault -o default sqop
