#compdef artem

autoload -U is-at-least

_artem() {
    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[@]}" \
'*-c+[Change the characters that are used to display the image.The first character should have the highest '\''darkness'\'' and the last should have the least (recommended to be a space '\'' '\''). A lower detail map is recommend for smaller images. Included characters can be used with the argument 0 | 1 | 2. If no characters are passed in, the default set will be used.]: :( )' \
'*--characters=[Change the characters that are used to display the image.The first character should have the highest '\''darkness'\'' and the last should have the least (recommended to be a space '\'' '\''). A lower detail map is recommend for smaller images. Included characters can be used with the argument 0 | 1 | 2. If no characters are passed in, the default set will be used.]: :( )' \
'(--height -w --width)-s+[Change the size of the output image. The minimum size is 20. Lower values will be ignored and changed to 20. This argument is conflicting with --width and --height.]: :( )' \
'(--height -w --width)--size=[Change the size of the output image. The minimum size is 20. Lower values will be ignored and changed to 20. This argument is conflicting with --width and --height.]: :( )' \
'--ratio=[Change the ratio between height and width, since ASCII characters are a bit higher than long. The value has to be between 0.1 and 1.0. It is not recommend to change this setting.]: :( )' \
'-o+[Output file for non-colored ascii. If the output file is a plaintext file, no color will be used. The use color, either use a file with an .ansi extension, or an .svg/.html file, to convert the output to the respective format. .ansi files will consider environment variables when creating colored output, for example when COLORTERM is not set to truecolor,the resulting file will fallback to 8-bit colors.]: :_files' \
'--output=[Output file for non-colored ascii. If the output file is a plaintext file, no color will be used. The use color, either use a file with an .ansi extension, or an .svg/.html file, to convert the output to the respective format. .ansi files will consider environment variables when creating colored output, for example when COLORTERM is not set to truecolor,the resulting file will fallback to 8-bit colors.]: :_files' \
'--verbose=[Choose the verbosity of the logging level. Warnings and errors will always be shown by default. To completely disable them, use the off argument.]: :((off\:"Do not show logs"
error\:"Only show errors"
warn\:"Show errors and warnings"
info\:"Show info logs"
debug\:"Show debug logs"
trace\:"Show trace logs"))' \
'(-w --width)--height[Use the terminal maximum terminal height to display the image. This argument is conflicting with --size and --width.]' \
'-w[Use the terminal maximum terminal width to display the image. This argument is conflicting with --size and --height.]' \
'--width[Use the terminal maximum terminal width to display the image. This argument is conflicting with --size and --height.]' \
'--flipX[Flip the image along the X-Axis/horizontally.]' \
'--flipY[Flip the image along the Y-Axis/vertically.]' \
'--centerX[Center the image along the X-Axis/horizontally in the terminal.]' \
'--centerY[Center the image along the Y-Axis/vertically in the terminal.]' \
'--invert[Inverts the characters used for the image, so light characters will as dark ones. Can be useful if the image has a dark background.]' \
'(--no-color)--background[Sets the background of the ascii as the color. This will be ignored if the terminal does not support truecolor. This argument is mutually exclusive with the no-color argument.]' \
'--border[Adds a decorative border surrounding the ascii image. This will make the image overall a bit smaller, since it respects the user given size.]' \
'--no-color[Do not use color when printing the image to the terminal.]' \
'--outline[Only create an outline of the image. This uses filters, so it will take more resources/time to complete, especially on larger images. It might not produce the desired output, it is advised to use this only on images with a clear distinction between foreground and background.]' \
'--hysteresis[When creating the outline use the hysteresis method, which will remove imperfection, but might not be as good looking in ascii form.This will require the --outline argument to be present as well.]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
'*::INPUT -- Paths or URLs to the target image. If the input is an URL, the image is downloaded and then converted. The original image is NOT altered.:_files' \
&& ret=0
}

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

if [ "$funcstack[1]" = "_artem" ]; then
    _artem "$@"
else
    compdef _artem artem
fi
