_wpaperctl() {
    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="wpaperctl"
                ;;
            wpaperctl,all-wallpapers)
                cmd="wpaperctl__all__wallpapers"
                ;;
            wpaperctl,get)
                cmd="wpaperctl__get__wallpaper"
                ;;
            wpaperctl,get-all)
                cmd="wpaperctl__all__wallpapers"
                ;;
            wpaperctl,get-status)
                cmd="wpaperctl__get__status"
                ;;
            wpaperctl,get-wallpaper)
                cmd="wpaperctl__get__wallpaper"
                ;;
            wpaperctl,help)
                cmd="wpaperctl__help"
                ;;
            wpaperctl,next)
                cmd="wpaperctl__next__wallpaper"
                ;;
            wpaperctl,next-wallpaper)
                cmd="wpaperctl__next__wallpaper"
                ;;
            wpaperctl,pause)
                cmd="wpaperctl__pause__wallpaper"
                ;;
            wpaperctl,pause-wallpaper)
                cmd="wpaperctl__pause__wallpaper"
                ;;
            wpaperctl,previous)
                cmd="wpaperctl__previous__wallpaper"
                ;;
            wpaperctl,previous-wallpaper)
                cmd="wpaperctl__previous__wallpaper"
                ;;
            wpaperctl,reload)
                cmd="wpaperctl__reload__wallpaper"
                ;;
            wpaperctl,reload-wallpaper)
                cmd="wpaperctl__reload__wallpaper"
                ;;
            wpaperctl,resume)
                cmd="wpaperctl__resume__wallpaper"
                ;;
            wpaperctl,resume-wallpaper)
                cmd="wpaperctl__resume__wallpaper"
                ;;
            wpaperctl,status)
                cmd="wpaperctl__get__status"
                ;;
            wpaperctl,toggle-pause)
                cmd="wpaperctl__toggle__pause__wallpaper"
                ;;
            wpaperctl,toggle-pause-wallpaper)
                cmd="wpaperctl__toggle__pause__wallpaper"
                ;;
            wpaperctl__help,all-wallpapers)
                cmd="wpaperctl__help__all__wallpapers"
                ;;
            wpaperctl__help,get-status)
                cmd="wpaperctl__help__get__status"
                ;;
            wpaperctl__help,get-wallpaper)
                cmd="wpaperctl__help__get__wallpaper"
                ;;
            wpaperctl__help,help)
                cmd="wpaperctl__help__help"
                ;;
            wpaperctl__help,next-wallpaper)
                cmd="wpaperctl__help__next__wallpaper"
                ;;
            wpaperctl__help,pause-wallpaper)
                cmd="wpaperctl__help__pause__wallpaper"
                ;;
            wpaperctl__help,previous-wallpaper)
                cmd="wpaperctl__help__previous__wallpaper"
                ;;
            wpaperctl__help,reload-wallpaper)
                cmd="wpaperctl__help__reload__wallpaper"
                ;;
            wpaperctl__help,resume-wallpaper)
                cmd="wpaperctl__help__resume__wallpaper"
                ;;
            wpaperctl__help,toggle-pause-wallpaper)
                cmd="wpaperctl__help__toggle__pause__wallpaper"
                ;;
            *)
                ;;
        esac
    done

    case "${cmd}" in
        wpaperctl)
            opts="-h -V --help --version get-wallpaper get all-wallpapers get-all next-wallpaper next previous-wallpaper previous reload-wallpaper reload pause-wallpaper pause resume-wallpaper resume toggle-pause-wallpaper toggle-pause get-status status 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
            ;;
        wpaperctl__all__wallpapers)
            opts="-j -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
            ;;
        wpaperctl__get__status)
            opts="-j -h --json --help [MONITORS]..."
            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
            ;;
        wpaperctl__get__wallpaper)
            opts="-h --help <MONITOR>"
            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
            ;;
        wpaperctl__help)
            opts="get-wallpaper all-wallpapers next-wallpaper previous-wallpaper reload-wallpaper pause-wallpaper resume-wallpaper toggle-pause-wallpaper get-status 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
            ;;
        wpaperctl__help__all__wallpapers)
            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
            ;;
        wpaperctl__help__get__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
            ;;
        wpaperctl__help__get__wallpaper)
            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
            ;;
        wpaperctl__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
            ;;
        wpaperctl__help__next__wallpaper)
            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
            ;;
        wpaperctl__help__pause__wallpaper)
            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
            ;;
        wpaperctl__help__previous__wallpaper)
            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
            ;;
        wpaperctl__help__reload__wallpaper)
            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
            ;;
        wpaperctl__help__resume__wallpaper)
            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
            ;;
        wpaperctl__help__toggle__pause__wallpaper)
            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
            ;;
        wpaperctl__next__wallpaper)
            opts="-h --help [MONITORS]..."
            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
            ;;
        wpaperctl__pause__wallpaper)
            opts="-h --help [MONITORS]..."
            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
            ;;
        wpaperctl__previous__wallpaper)
            opts="-h --help [MONITORS]..."
            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
            ;;
        wpaperctl__reload__wallpaper)
            opts="-h --help [MONITORS]..."
            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
            ;;
        wpaperctl__resume__wallpaper)
            opts="-h --help [MONITORS]..."
            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
            ;;
        wpaperctl__toggle__pause__wallpaper)
            opts="-h --help [MONITORS]..."
            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 _wpaperctl -o nosort -o bashdefault -o default wpaperctl
else
    complete -F _wpaperctl -o bashdefault -o default wpaperctl
fi
