#compdef rwpspread

autoload -U is-at-least

_rwpspread() {
    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[@]}" : \
'-i+[Image file or directory path]:IMAGE:_default' \
'--image=[Image file or directory path]:IMAGE:_default' \
'-o+[Output directory path]:OUTPUT:_default' \
'--output=[Output directory path]:OUTPUT:_default' \
'-a+[Do not downscale the base image, align the layout instead]:ALIGN:(tl tr tc bl br bc rc lc ct)' \
'--align=[Do not downscale the base image, align the layout instead]:ALIGN:(tl tr tc bl br bc rc lc ct)' \
'-b+[Wallpaper setter backend]:BACKEND:(wpaperd swaybg hyprpaper)' \
'--backend=[Wallpaper setter backend]:BACKEND:(wpaperd swaybg hyprpaper)' \
'-l+[Lockscreen implementation to generate for]:LOCKER:(swaylock hyprlock)' \
'--locker=[Lockscreen implementation to generate for]:LOCKER:(swaylock hyprlock)' \
'-c+[Compensate for bezel amount in pixels]:COMPENSATE:_default' \
'--compensate=[Compensate for bezel amount in pixels]:COMPENSATE:_default' \
'--pre=[Script to execute before splitting]:PRE:_default' \
'--post=[Script to execute after splitting]:POST:_default' \
'--info[Show detectable information]' \
'-d[Enable daemon mode and resplit on output changes]' \
'--daemon[Enable daemon mode and resplit on output changes]' \
'-p[Generate a color palette from input image]' \
'--palette[Generate a color palette from input image]' \
'-f[Force resplit, skips all image cache checks]' \
'--force-resplit[Force resplit, skips all image cache checks]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
}

(( $+functions[_rwpspread_commands] )) ||
_rwpspread_commands() {
    local commands; commands=()
    _describe -t commands 'rwpspread commands' commands "$@"
}

if [ "$funcstack[1]" = "_rwpspread" ]; then
    _rwpspread "$@"
else
    compdef _rwpspread rwpspread
fi
