_smart__mount() {
    local i cur prev opts cmd
    COMPREPLY=()
    if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then
        cur="$2"
    else
        cur="${COMP_WORDS[COMP_CWORD]}"
    fi
    prev="$3"
    cmd=""
    opts=""

    for i in "${COMP_WORDS[@]:0:COMP_CWORD}"
    do
        case "${cmd},${i}" in
            ",$1")
                cmd="smart__mount"
                ;;
            smart__mount,doctor)
                cmd="smart__mount__subcmd__doctor"
                ;;
            smart__mount,drive)
                cmd="smart__mount__subcmd__drive"
                ;;
            smart__mount,help)
                cmd="smart__mount__subcmd__help"
                ;;
            smart__mount,mount)
                cmd="smart__mount__subcmd__mount"
                ;;
            smart__mount,status)
                cmd="smart__mount__subcmd__status"
                ;;
            smart__mount,unmount)
                cmd="smart__mount__subcmd__unmount"
                ;;
            smart__mount,watch)
                cmd="smart__mount__subcmd__watch"
                ;;
            smart__mount__subcmd__drive,add)
                cmd="smart__mount__subcmd__drive__subcmd__add"
                ;;
            smart__mount__subcmd__drive,edit)
                cmd="smart__mount__subcmd__drive__subcmd__edit"
                ;;
            smart__mount__subcmd__drive,help)
                cmd="smart__mount__subcmd__drive__subcmd__help"
                ;;
            smart__mount__subcmd__drive,list)
                cmd="smart__mount__subcmd__drive__subcmd__list"
                ;;
            smart__mount__subcmd__drive,remove)
                cmd="smart__mount__subcmd__drive__subcmd__remove"
                ;;
            smart__mount__subcmd__drive__subcmd__help,add)
                cmd="smart__mount__subcmd__drive__subcmd__help__subcmd__add"
                ;;
            smart__mount__subcmd__drive__subcmd__help,edit)
                cmd="smart__mount__subcmd__drive__subcmd__help__subcmd__edit"
                ;;
            smart__mount__subcmd__drive__subcmd__help,help)
                cmd="smart__mount__subcmd__drive__subcmd__help__subcmd__help"
                ;;
            smart__mount__subcmd__drive__subcmd__help,list)
                cmd="smart__mount__subcmd__drive__subcmd__help__subcmd__list"
                ;;
            smart__mount__subcmd__drive__subcmd__help,remove)
                cmd="smart__mount__subcmd__drive__subcmd__help__subcmd__remove"
                ;;
            smart__mount__subcmd__help,doctor)
                cmd="smart__mount__subcmd__help__subcmd__doctor"
                ;;
            smart__mount__subcmd__help,drive)
                cmd="smart__mount__subcmd__help__subcmd__drive"
                ;;
            smart__mount__subcmd__help,help)
                cmd="smart__mount__subcmd__help__subcmd__help"
                ;;
            smart__mount__subcmd__help,mount)
                cmd="smart__mount__subcmd__help__subcmd__mount"
                ;;
            smart__mount__subcmd__help,status)
                cmd="smart__mount__subcmd__help__subcmd__status"
                ;;
            smart__mount__subcmd__help,unmount)
                cmd="smart__mount__subcmd__help__subcmd__unmount"
                ;;
            smart__mount__subcmd__help,watch)
                cmd="smart__mount__subcmd__help__subcmd__watch"
                ;;
            smart__mount__subcmd__help__subcmd__drive,add)
                cmd="smart__mount__subcmd__help__subcmd__drive__subcmd__add"
                ;;
            smart__mount__subcmd__help__subcmd__drive,edit)
                cmd="smart__mount__subcmd__help__subcmd__drive__subcmd__edit"
                ;;
            smart__mount__subcmd__help__subcmd__drive,list)
                cmd="smart__mount__subcmd__help__subcmd__drive__subcmd__list"
                ;;
            smart__mount__subcmd__help__subcmd__drive,remove)
                cmd="smart__mount__subcmd__help__subcmd__drive__subcmd__remove"
                ;;
            *)
                ;;
        esac
    done

    case "${cmd}" in
        smart__mount)
            opts="-h -V --help --version drive mount unmount status watch doctor 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
            ;;
        smart__subcmd__mount__subcmd__doctor)
            opts="-h --json --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
            ;;
        smart__subcmd__mount__subcmd__drive)
            opts="-h --help add edit remove list 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
            ;;
        smart__subcmd__mount__subcmd__drive__subcmd__add)
            opts="-h --name --mount-point --owner-user --local-kind --local-ip --local-mac --local-share --local-username --local-password --local-password-stdin --cloud-kind --cloud-host --cloud-share --cloud-username --cloud-password --cloud-password-stdin --non-interactive --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --name)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --mount-point)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --owner-user)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --local-kind)
                    COMPREPLY=($(compgen -W "webdav smb nfs" -- "${cur}"))
                    return 0
                    ;;
                --local-ip)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --local-mac)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --local-share)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --local-username)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --local-password)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --cloud-kind)
                    COMPREPLY=($(compgen -W "webdav smb nfs" -- "${cur}"))
                    return 0
                    ;;
                --cloud-host)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --cloud-share)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --cloud-username)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --cloud-password)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        smart__subcmd__mount__subcmd__drive__subcmd__edit)
            opts="-h --name --mount-point --owner-user --local-kind --local-ip --local-mac --local-share --local-username --local-password --local-password-stdin --cloud-kind --cloud-host --cloud-share --cloud-username --cloud-password --cloud-password-stdin --non-interactive --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --name)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --mount-point)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --owner-user)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --local-kind)
                    COMPREPLY=($(compgen -W "webdav smb nfs" -- "${cur}"))
                    return 0
                    ;;
                --local-ip)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --local-mac)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --local-share)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --local-username)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --local-password)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --cloud-kind)
                    COMPREPLY=($(compgen -W "webdav smb nfs" -- "${cur}"))
                    return 0
                    ;;
                --cloud-host)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --cloud-share)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --cloud-username)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --cloud-password)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        smart__subcmd__mount__subcmd__drive__subcmd__help)
            opts="add edit remove list 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
            ;;
        smart__subcmd__mount__subcmd__drive__subcmd__help__subcmd__add)
            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
            ;;
        smart__subcmd__mount__subcmd__drive__subcmd__help__subcmd__edit)
            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
            ;;
        smart__subcmd__mount__subcmd__drive__subcmd__help__subcmd__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
            ;;
        smart__subcmd__mount__subcmd__drive__subcmd__help__subcmd__list)
            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
            ;;
        smart__subcmd__mount__subcmd__drive__subcmd__help__subcmd__remove)
            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
            ;;
        smart__subcmd__mount__subcmd__drive__subcmd__list)
            opts="-h --json --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
            ;;
        smart__subcmd__mount__subcmd__drive__subcmd__remove)
            opts="-h --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
            ;;
        smart__subcmd__mount__subcmd__help)
            opts="drive mount unmount status watch doctor 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
            ;;
        smart__subcmd__mount__subcmd__help__subcmd__doctor)
            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
            ;;
        smart__subcmd__mount__subcmd__help__subcmd__drive)
            opts="add edit remove list"
            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
            ;;
        smart__subcmd__mount__subcmd__help__subcmd__drive__subcmd__add)
            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
            ;;
        smart__subcmd__mount__subcmd__help__subcmd__drive__subcmd__edit)
            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
            ;;
        smart__subcmd__mount__subcmd__help__subcmd__drive__subcmd__list)
            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
            ;;
        smart__subcmd__mount__subcmd__help__subcmd__drive__subcmd__remove)
            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
            ;;
        smart__subcmd__mount__subcmd__help__subcmd__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
            ;;
        smart__subcmd__mount__subcmd__help__subcmd__mount)
            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
            ;;
        smart__subcmd__mount__subcmd__help__subcmd__status)
            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
            ;;
        smart__subcmd__mount__subcmd__help__subcmd__unmount)
            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
            ;;
        smart__subcmd__mount__subcmd__help__subcmd__watch)
            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
            ;;
        smart__subcmd__mount__subcmd__mount)
            opts="-h --name --all --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --name)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        smart__subcmd__mount__subcmd__status)
            opts="-h --name --json --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --name)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        smart__subcmd__mount__subcmd__unmount)
            opts="-h --name --all --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --name)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        smart__subcmd__mount__subcmd__watch)
            opts="-h --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
            ;;
    esac
}

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