#compdef girouette

autoload -U is-at-least

_girouette() {
    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[@]}" \
'-k+[OpenWeather API key (required for anything more than light testing)]:KEY: ' \
'--key=[OpenWeather API key (required for anything more than light testing)]:KEY: ' \
'-l+[Location to query (required if not set in config)]:LOCATION:_files' \
'--location=[Location to query (required if not set in config)]:LOCATION:_files' \
'--config=[Use the specified configuration file instead of the default]:FILE: ' \
'-c+[Cache responses for this long (e.g. "1m", "2 days 6h", "5 sec"), or `none` to disable it]:DURATION: ' \
'--cache=[Cache responses for this long (e.g. "1m", "2 days 6h", "5 sec"), or `none` to disable it]:DURATION: ' \
'-L+[Use this language for location names, weather descriptions and date formatting]:LANGUAGE: ' \
'--language=[Use this language for location names, weather descriptions and date formatting]:LANGUAGE: ' \
'-u+[Units to use when displaying temperatures and speeds]:UNIT:(metric imperial standard)' \
'--units=[Units to use when displaying temperatures and speeds]:UNIT:(metric imperial standard)' \
'(-c --cache)-o[Run only offline with responses from the cache]' \
'(-c --cache)--offline[Run only offline with responses from the cache]' \
'*-v[Pass for more log output]' \
'*--verbose[Pass for more log output]' \
'(-v --verbose)*-q[Pass for less log output]' \
'(-v --verbose)*--quiet[Pass for less log output]' \
'--clean-cache[Removes all cached responses and exits]' \
'--print-default-config[Prints the contents of the default configuration and exits]' \
'-h[Print help information]' \
'--help[Print help information]' \
'-V[Print version information]' \
'--version[Print version information]' \
&& ret=0
}

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

_girouette "$@"
