_uu-realpath() {
    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__realpath"
                ;;
            *)
                ;;
        esac
    done

    case "${cmd}" in
        uu__realpath)
            opts="-h -V -q -s -z -L -P -e -m --help --version --quiet --strip --zero --logical --physical --canonicalize-existing --canonicalize-missing <files>..."
            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
            ;;
    esac
}

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