#compdef btm

autoload -U is-at-least

_btm() {
    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+[Sets the location of the config file.]:CONFIG PATH: ' \
'--config=[Sets the location of the config file.]:CONFIG PATH: ' \
'--color=[Use a color scheme, use --help for info.]:COLOR SCHEME:(default default-light gruvbox gruvbox-light nord nord-light)' \
'-t+[Default time value for graphs in ms.]:MS: ' \
'--default_time_value=[Default time value for graphs in ms.]:MS: ' \
'--default_widget_count=[Sets the n'\''th selected widget type as the default.]:INT: ' \
'--default_widget_type=[Sets the default widget type, use --help for info.]:WIDGET TYPE: ' \
'-r+[Sets a refresh rate in ms.]:MS: ' \
'--rate=[Sets a refresh rate in ms.]:MS: ' \
'-d+[The amount in ms changed upon zooming.]:MS: ' \
'--time_delta=[The amount in ms changed upon zooming.]:MS: ' \
'--retention=[The timespan of data kept.]:time: ' \
'-h[Prints help information. Use --help for info.]' \
'--help[Prints help information. Use --help for info.]' \
'-V[Prints version information.]' \
'--version[Prints version information.]' \
'-k[Sets the temperature type to Kelvin.]' \
'--kelvin[Sets the temperature type to Kelvin.]' \
'-f[Sets the temperature type to Fahrenheit.]' \
'--fahrenheit[Sets the temperature type to Fahrenheit.]' \
'-c[Sets the temperature type to Celsius.]' \
'--celsius[Sets the temperature type to Celsius.]' \
'--autohide_time[Temporarily shows the time scale in graphs.]' \
'-b[Hides graphs and uses a more basic look.]' \
'--basic[Hides graphs and uses a more basic look.]' \
'-S[Enables case sensitivity by default.]' \
'--case_sensitive[Enables case sensitivity by default.]' \
'--process_command[Show processes as their commands by default.]' \
'--mem_as_value[Defaults to showing process memory usage by value.]' \
'--disable_click[Disables mouse clicks.]' \
'-m[Uses a dot marker for graphs.]' \
'--dot_marker[Uses a dot marker for graphs.]' \
'-g[Groups processes with the same name by default.]' \
'--group[Groups processes with the same name by default.]' \
'-a[Hides the average CPU usage.]' \
'--hide_avg_cpu[Hides the average CPU usage.]' \
'--hide_table_gap[Hides spacing between table headers and entries.]' \
'--hide_time[Hides the time scale.]' \
'--show_table_scroll_position[Shows the scroll position tracker in table widgets.]' \
'-l[Puts the CPU chart legend to the left side.]' \
'--left_legend[Puts the CPU chart legend to the left side.]' \
'--disable_advanced_kill[Hides advanced process killing.]' \
'-R[Enables regex by default.]' \
'--regex[Enables regex by default.]' \
'-T[Defaults the process widget be in tree mode.]' \
'--tree[Defaults the process widget be in tree mode.]' \
'--network_use_bytes[Displays the network widget using bytes.]' \
'--network_use_log[Displays the network widget with a log scale.]' \
'--network_use_binary_prefix[Displays the network widget with binary prefixes.]' \
'-u[Sets process CPU% to be based on current CPU%.]' \
'--current_usage[Sets process CPU% to be based on current CPU%.]' \
'-n[Show process CPU% without normalizing over the number of cores.]' \
'--unnormalized_cpu[Show process CPU% without normalizing over the number of cores.]' \
'--use_old_network_legend[DEPRECATED - uses a separate network legend.]' \
'-W[Enables whole-word matching by default.]' \
'--whole_word[Enables whole-word matching by default.]' \
'-e[Expand the default widget upon starting the app.]' \
'--expanded[Expand the default widget upon starting the app.]' \
'--battery[Shows the battery widget.]' \
'--enable_gpu_memory[Enable collecting and displaying GPU memory usage.]' \
&& ret=0
}

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

_btm "$@"
