#compdef hyprdim

autoload -U is-at-least

_hyprdim() {
    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[@]}" : \
'-s+[A value from 0 (no dim) to 1 (maximum dim)]:STRENGTH:_default' \
'--strength=[A value from 0 (no dim) to 1 (maximum dim)]:STRENGTH:_default' \
'-d+[How many milliseconds to wait before removing dim]:DURATION:_default' \
'--duration=[How many milliseconds to wait before removing dim]:DURATION:_default' \
'-f+[Fade animation speed from 0 (instantaneous) to 255 (very slow)]:FADE:_default' \
'--fade=[Fade animation speed from 0 (instantaneous) to 255 (very slow)]:FADE:_default' \
'-b+[Bezier curve used for the animation]:BEZIER:_default' \
'--bezier=[Bezier curve used for the animation]:BEZIER:_default' \
'-D+[Strength of dim for windows that are the same class and floating]:DIALOG_DIM:_default' \
'--dialog-dim=[Strength of dim for windows that are the same class and floating]:DIALOG_DIM:_default' \
'-v[Show information about what hyprdim is doing]' \
'--verbose[Show information about what hyprdim is doing]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
}

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

if [ "$funcstack[1]" = "_hyprdim" ]; then
    _hyprdim "$@"
else
    compdef _hyprdim hyprdim
fi
