#compdef apt-gen-list

autoload -U is-at-least

_apt-gen-list() {
    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[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
":: :_apt-gen-list_commands" \
"*::: :->apt-gen-list-rs" \
&& ret=0
    case $state in
    (apt-gen-list-rs)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:apt-gen-list-command-$line[1]:"
        case $line[1] in
            (set-branch)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':BRANCH -- Input branch name here:_files' \
&& ret=0
;;
(set-mirror)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':MIRROR -- source.list mirror:_files' \
&& ret=0
;;
(add-mirror)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':MIRROR -- source.list mirror:_files' \
&& ret=0
;;
(remove-mirror)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':MIRROR -- remove source.list mirror:_files' \
&& ret=0
;;
(status)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(add-component)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':COMPONENT -- Input component name:_files' \
&& ret=0
;;
(remove-component)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':COMPONENT -- Input component name to be removed:_files' \
&& ret=0
;;
(add-custom-mirror)
_arguments "${_arguments_options[@]}" \
'-s[also set mirror as default]' \
'--also-set-mirror[also set mirror as default]' \
'(-s --also-set-mirror)-a[also add mirror to list]' \
'(-s --also-set-mirror)--also-add-mirror[also add mirror to list]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':MIRROR_NAME -- custom repository mirror name:_files' \
':MIRROR_URL -- custom repository mirror url:_files' \
&& ret=0
;;
(remove-custom-mirror)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':MIRROR -- Input custom repository mirror name to remove from the list of custom mirrors:_files' \
&& ret=0
;;
(speedtest)
_arguments "${_arguments_options[@]}" \
'-p[Test mirror performance concurrently, test will take a shorter amount of time, but results will only serve as a rough estimate and could vary between runs]' \
'--parallel[Test mirror performance concurrently, test will take a shorter amount of time, but results will only serve as a rough estimate and could vary between runs]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(list-mirrors)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(set-fastest-mirror-as-default)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(reset-mirror)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
        esac
    ;;
esac
}

(( $+functions[_apt-gen-list_commands] )) ||
_apt-gen-list_commands() {
    local commands; commands=(
        "set-branch:Set APT repository branch (e.g., stable)" \
"set-mirror:Set APT repository mirror" \
"add-mirror:Add additional APT repository mirror" \
"remove-mirror:Remove APT repository mirror" \
"status:Show apt-gen-list status" \
"add-component:Set APT repository component" \
"remove-component:Remove APT repository component" \
"add-custom-mirror:Add custom repository mirror" \
"remove-custom-mirror:Remove custom repository mirror" \
"speedtest:Run speed-test on available mirrors" \
"list-mirrors:Show available mirror list" \
"set-fastest-mirror-as-default:Set fastest mirror as default" \
"reset-mirror:Reset mirror to default" \
"help:Prints this message or the help of the given subcommand(s)" \
    )
    _describe -t commands 'apt-gen-list commands' commands "$@"
}
(( $+functions[_apt-gen-list__add-component_commands] )) ||
_apt-gen-list__add-component_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'apt-gen-list add-component commands' commands "$@"
}
(( $+functions[_apt-gen-list__add-custom-mirror_commands] )) ||
_apt-gen-list__add-custom-mirror_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'apt-gen-list add-custom-mirror commands' commands "$@"
}
(( $+functions[_apt-gen-list__add-mirror_commands] )) ||
_apt-gen-list__add-mirror_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'apt-gen-list add-mirror commands' commands "$@"
}
(( $+functions[_apt-gen-list__help_commands] )) ||
_apt-gen-list__help_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'apt-gen-list help commands' commands "$@"
}
(( $+functions[_apt-gen-list__list-mirrors_commands] )) ||
_apt-gen-list__list-mirrors_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'apt-gen-list list-mirrors commands' commands "$@"
}
(( $+functions[_apt-gen-list__remove-component_commands] )) ||
_apt-gen-list__remove-component_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'apt-gen-list remove-component commands' commands "$@"
}
(( $+functions[_apt-gen-list__remove-custom-mirror_commands] )) ||
_apt-gen-list__remove-custom-mirror_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'apt-gen-list remove-custom-mirror commands' commands "$@"
}
(( $+functions[_apt-gen-list__remove-mirror_commands] )) ||
_apt-gen-list__remove-mirror_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'apt-gen-list remove-mirror commands' commands "$@"
}
(( $+functions[_apt-gen-list__reset-mirror_commands] )) ||
_apt-gen-list__reset-mirror_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'apt-gen-list reset-mirror commands' commands "$@"
}
(( $+functions[_apt-gen-list__set-branch_commands] )) ||
_apt-gen-list__set-branch_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'apt-gen-list set-branch commands' commands "$@"
}
(( $+functions[_apt-gen-list__set-fastest-mirror-as-default_commands] )) ||
_apt-gen-list__set-fastest-mirror-as-default_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'apt-gen-list set-fastest-mirror-as-default commands' commands "$@"
}
(( $+functions[_apt-gen-list__set-mirror_commands] )) ||
_apt-gen-list__set-mirror_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'apt-gen-list set-mirror commands' commands "$@"
}
(( $+functions[_apt-gen-list__speedtest_commands] )) ||
_apt-gen-list__speedtest_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'apt-gen-list speedtest commands' commands "$@"
}
(( $+functions[_apt-gen-list__status_commands] )) ||
_apt-gen-list__status_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'apt-gen-list status commands' commands "$@"
}

_apt-gen-list "$@"