_uu-dd() {
    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
            "$1")
                cmd="uu__dd"
                ;;
            *)
                ;;
        esac
    done

    case "${cmd}" in
        uu__dd)
            opts="-h -V --help --version --if --of --ibs --obs --bs --cbs --skip --seek --iseek --oseek --count --status --conv --iflag --oflag"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --if)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --of)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --ibs)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --obs)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --bs)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --cbs)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --skip)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --seek)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --iseek)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --oseek)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --count)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --status)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --conv)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --iflag)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --oflag)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
    esac
}

complete -F _uu-dd -o bashdefault -o default uu-dd
