#compdef wpaperctl

autoload -U is-at-least

_wpaperctl() {
    typeset -A opt_args
    typeset -a _arguments_options
    local ret=1

    if is-at-least 5.2; then
        _arguments_options=(-s -S -C)
    else
        _arguments_options=(-s -C)
    fi

    local context curcontext="$curcontext" state line
    _arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_wpaperctl_commands" \
"*::: :->wpaperctl" \
&& ret=0
    case $state in
    (wpaperctl)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:wpaperctl-command-$line[1]:"
        case $line[1] in
            (get-wallpaper)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':monitor:_default' \
&& ret=0
;;
(get)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':monitor:_default' \
&& ret=0
;;
(all-wallpapers)
_arguments "${_arguments_options[@]}" : \
'-j[]' \
'--json[]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(get-all)
_arguments "${_arguments_options[@]}" : \
'-j[]' \
'--json[]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(next-wallpaper)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'*::monitors:_default' \
&& ret=0
;;
(next)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'*::monitors:_default' \
&& ret=0
;;
(previous-wallpaper)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'*::monitors:_default' \
&& ret=0
;;
(previous)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'*::monitors:_default' \
&& ret=0
;;
(reload-wallpaper)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'*::monitors:_default' \
&& ret=0
;;
(reload)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'*::monitors:_default' \
&& ret=0
;;
(pause-wallpaper)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'*::monitors:_default' \
&& ret=0
;;
(pause)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'*::monitors:_default' \
&& ret=0
;;
(resume-wallpaper)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'*::monitors:_default' \
&& ret=0
;;
(resume)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'*::monitors:_default' \
&& ret=0
;;
(toggle-pause-wallpaper)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'*::monitors:_default' \
&& ret=0
;;
(toggle-pause)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'*::monitors:_default' \
&& ret=0
;;
(get-status)
_arguments "${_arguments_options[@]}" : \
'-j[]' \
'--json[]' \
'-h[Print help]' \
'--help[Print help]' \
'*::monitors:_default' \
&& ret=0
;;
(status)
_arguments "${_arguments_options[@]}" : \
'-j[]' \
'--json[]' \
'-h[Print help]' \
'--help[Print help]' \
'*::monitors:_default' \
&& ret=0
;;
(set-wallpaper)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':path -- Path to the image file:_files' \
'*::monitors -- Monitors to set wallpaper on (if empty, sets on all monitors):_default' \
&& ret=0
;;
(set)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':path -- Path to the image file:_files' \
'*::monitors -- Monitors to set wallpaper on (if empty, sets on all monitors):_default' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_wpaperctl__subcmd__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:wpaperctl-help-command-$line[1]:"
        case $line[1] in
            (get-wallpaper)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(all-wallpapers)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(next-wallpaper)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(previous-wallpaper)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(reload-wallpaper)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(pause-wallpaper)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(resume-wallpaper)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(toggle-pause-wallpaper)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(get-status)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(set-wallpaper)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_wpaperctl_commands] )) ||
_wpaperctl_commands() {
    local commands; commands=(
'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:' \
'set-wallpaper:Set wallpaper to a specific image file' \
'set:Set wallpaper to a specific image file' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'wpaperctl commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__all-wallpapers_commands] )) ||
_wpaperctl__subcmd__all-wallpapers_commands() {
    local commands; commands=()
    _describe -t commands 'wpaperctl all-wallpapers commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__get-status_commands] )) ||
_wpaperctl__subcmd__get-status_commands() {
    local commands; commands=()
    _describe -t commands 'wpaperctl get-status commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__get-wallpaper_commands] )) ||
_wpaperctl__subcmd__get-wallpaper_commands() {
    local commands; commands=()
    _describe -t commands 'wpaperctl get-wallpaper commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__help_commands] )) ||
_wpaperctl__subcmd__help_commands() {
    local commands; commands=(
'get-wallpaper:' \
'all-wallpapers:' \
'next-wallpaper:' \
'previous-wallpaper:' \
'reload-wallpaper:' \
'pause-wallpaper:' \
'resume-wallpaper:' \
'toggle-pause-wallpaper:' \
'get-status:' \
'set-wallpaper:Set wallpaper to a specific image file' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'wpaperctl help commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__help__subcmd__all-wallpapers_commands] )) ||
_wpaperctl__subcmd__help__subcmd__all-wallpapers_commands() {
    local commands; commands=()
    _describe -t commands 'wpaperctl help all-wallpapers commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__help__subcmd__get-status_commands] )) ||
_wpaperctl__subcmd__help__subcmd__get-status_commands() {
    local commands; commands=()
    _describe -t commands 'wpaperctl help get-status commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__help__subcmd__get-wallpaper_commands] )) ||
_wpaperctl__subcmd__help__subcmd__get-wallpaper_commands() {
    local commands; commands=()
    _describe -t commands 'wpaperctl help get-wallpaper commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__help__subcmd__help_commands] )) ||
_wpaperctl__subcmd__help__subcmd__help_commands() {
    local commands; commands=()
    _describe -t commands 'wpaperctl help help commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__help__subcmd__next-wallpaper_commands] )) ||
_wpaperctl__subcmd__help__subcmd__next-wallpaper_commands() {
    local commands; commands=()
    _describe -t commands 'wpaperctl help next-wallpaper commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__help__subcmd__pause-wallpaper_commands] )) ||
_wpaperctl__subcmd__help__subcmd__pause-wallpaper_commands() {
    local commands; commands=()
    _describe -t commands 'wpaperctl help pause-wallpaper commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__help__subcmd__previous-wallpaper_commands] )) ||
_wpaperctl__subcmd__help__subcmd__previous-wallpaper_commands() {
    local commands; commands=()
    _describe -t commands 'wpaperctl help previous-wallpaper commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__help__subcmd__reload-wallpaper_commands] )) ||
_wpaperctl__subcmd__help__subcmd__reload-wallpaper_commands() {
    local commands; commands=()
    _describe -t commands 'wpaperctl help reload-wallpaper commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__help__subcmd__resume-wallpaper_commands] )) ||
_wpaperctl__subcmd__help__subcmd__resume-wallpaper_commands() {
    local commands; commands=()
    _describe -t commands 'wpaperctl help resume-wallpaper commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__help__subcmd__set-wallpaper_commands] )) ||
_wpaperctl__subcmd__help__subcmd__set-wallpaper_commands() {
    local commands; commands=()
    _describe -t commands 'wpaperctl help set-wallpaper commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__help__subcmd__toggle-pause-wallpaper_commands] )) ||
_wpaperctl__subcmd__help__subcmd__toggle-pause-wallpaper_commands() {
    local commands; commands=()
    _describe -t commands 'wpaperctl help toggle-pause-wallpaper commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__next-wallpaper_commands] )) ||
_wpaperctl__subcmd__next-wallpaper_commands() {
    local commands; commands=()
    _describe -t commands 'wpaperctl next-wallpaper commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__pause-wallpaper_commands] )) ||
_wpaperctl__subcmd__pause-wallpaper_commands() {
    local commands; commands=()
    _describe -t commands 'wpaperctl pause-wallpaper commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__previous-wallpaper_commands] )) ||
_wpaperctl__subcmd__previous-wallpaper_commands() {
    local commands; commands=()
    _describe -t commands 'wpaperctl previous-wallpaper commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__reload-wallpaper_commands] )) ||
_wpaperctl__subcmd__reload-wallpaper_commands() {
    local commands; commands=()
    _describe -t commands 'wpaperctl reload-wallpaper commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__resume-wallpaper_commands] )) ||
_wpaperctl__subcmd__resume-wallpaper_commands() {
    local commands; commands=()
    _describe -t commands 'wpaperctl resume-wallpaper commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__set-wallpaper_commands] )) ||
_wpaperctl__subcmd__set-wallpaper_commands() {
    local commands; commands=()
    _describe -t commands 'wpaperctl set-wallpaper commands' commands "$@"
}
(( $+functions[_wpaperctl__subcmd__toggle-pause-wallpaper_commands] )) ||
_wpaperctl__subcmd__toggle-pause-wallpaper_commands() {
    local commands; commands=()
    _describe -t commands 'wpaperctl toggle-pause-wallpaper commands' commands "$@"
}

if [ "$funcstack[1]" = "_wpaperctl" ]; then
    _wpaperctl "$@"
else
    compdef _wpaperctl wpaperctl
fi
