#compdef shiny-mirrors

autoload -U is-at-least

_shiny-mirrors() {
    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]' \
":: :_shiny-mirrors_commands" \
"*::: :->Shiny Mirrors" \
&& ret=0
    case $state in
    (Shiny Mirrors)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:shiny-mirrors-command-$line[1]:"
        case $line[1] in
            (conf)
_arguments "${_arguments_options[@]}" \
'(-b --branch -p --protocol -C --continent -c --country)--branch_value=[]: :(None Stable Testing Unstable)' \
'(-b --branch -p --protocol -C --continent -c --country)*--country_value=[]: :(None Global Algeria Angola Benin Botswana Burkina\ Faso Burundi Cameroon Cape\ Verde Central\ African\ Republic Chad Comoros Republic\ Of\ The\ Congo Democratic\ Republic\ Of\ The\ Congo Ivory\ Coast Djibouti Equatorial\ Guinea Egypt Eritrea Ethiopia Gabon Gambia Ghana Guinea Guinea\ Bissau Kenya Lesotho Liberia Libya Madagascar Malawi Mali Mauritania Mauritius Morocco Mayotte Mozambique Namibia Niger Nigeria Rwanda Reunion Sao\ Tome\ And\ Principe Senegal Seychelles Sierra\ Leone Somalia South\ Africa South\ Sudan Sudan Eswatini Tanzania Togo Tunisia Uganda Western\ Sahara Zambia Zimbabwe Afghanistan Armenia Azerbaijan Bahrain Bangladesh Bhutan Brunei Cambodia China East\ Timor India Indonesia Iran Iraq Israel Japan Jordan Kazakhstan Kuwait Kyrgyzstan Laos Lebanon Macau Malaysia Maldives Mongolia Myanmar Nepal North\ Korea Oman Pakistan Palestine Philippines Qatar Saudi\ Arabia Singapore South\ Korea Sri\ Lanka Syria Tajikistan Thailand Turkey Turkmenistan Taiwan United\ Arab\ Emirates Uzbekistan Vietnam Yemen Hong\ Kong Georgia Albania Andorra Austria Belarus Belgium Bosnia\ And\ Herzegovina Bulgaria Croatia Cyprus Czechia Denmark Estonia Finland Germany Greece Hungary Iceland Ireland Italy Kosovo Latvia Liechtenstein Lithuania Luxembourg North\ Macedonia Malta Moldova Monaco Montenegro Netherlands Norway Poland Portugal Romania Russia San\ Marino Serbia Slovakia Slovenia France Spain Sweden Switzerland Ukraine United\ Kingdom Vatican\ City Faroe\ Islands Isle\ Of\ Man Gibraltar Anguilla Antigua\ And\ Barbuda Bahamas Belize Bermuda Barbados British\ Virgin\ Islands Cayman\ Islands Canada Costa\ Rica Cuba Dominica Dominican\ Republic El\ Salvador Grenada Greenland Guatemala Guadeloupe Haiti Honduras Jamaica Martinique Mexico Montserrat Nicaragua Panama Puerto\ Rico Saint\ Barthelemy Saint\ Kitts\ And\ Nevis Saint\ Lucia Sint\ Maarten Saint\ Martin Saint\ Pierre\ And\ Miquelon Saint\ Vincent\ And\ The\ Grenadines Turks\ And\ Caicos\ Islands United\ States Us\ Virgin\ Islands Argentina Bolivia Brazil Chile Colombia Ecuador Falkland\ Islands French\ Guiana Guyana Peru Paraguay Trinidad\ And\ Tobago Uruguay Suriname Venezuela Curacao Aruba Australia Fiji New\ Zealand Micronesia Kiribati Marshall\ Islands Nauru Palau Papua\ New\ Guinea Samoa Solomon\ Islands Tonga Tuvalu Vanuatu Timor\ Leste New\ Caledonia French\ Polynesia Cook\ Islands Wallis\ And\ Futuna Niue Tokelau Northern\ Mariana\ Islands Guam)' \
'(-b --branch -p --protocol -C --continent -c --country)--continent_value=[]: :(None Europe Asia Oceania Africa North\ America South\ America)' \
'(-b --branch -p --protocol -C --continent -c --country)*--protocol_value=[]: :(None Http Https Ftp Ftps)' \
'-c[Set a list of countries to filter with]' \
'--country[Set a list of countries to filter with]' \
'-C[Set a continent to filter with]' \
'--continent[Set a continent to filter with]' \
'-p[Set a list of protocols to filter with]' \
'--protocol[Set a list of protocols to filter with]' \
'-b[Set a branch to filter with]' \
'--branch[Set a branch to filter with]' \
'(-b --branch -p --protocol -C --continent -c --country --branch_value --country_value --continent_value --protocol_value)-s[Set all settings options]' \
'(-b --branch -p --protocol -C --continent -c --country --branch_value --country_value --continent_value --protocol_value)--setup[Set all settings options]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
":: :_shiny-mirrors__config_commands" \
"*::: :->config" \
&& ret=0
case $state in
    (config)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:shiny-mirrors-config-command-$line[1]:"
        case $line[1] in
            (show)
_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
;;
(config)
_arguments "${_arguments_options[@]}" \
'(-b --branch -p --protocol -C --continent -c --country)--branch_value=[]: :(None Stable Testing Unstable)' \
'(-b --branch -p --protocol -C --continent -c --country)*--country_value=[]: :(None Global Algeria Angola Benin Botswana Burkina\ Faso Burundi Cameroon Cape\ Verde Central\ African\ Republic Chad Comoros Republic\ Of\ The\ Congo Democratic\ Republic\ Of\ The\ Congo Ivory\ Coast Djibouti Equatorial\ Guinea Egypt Eritrea Ethiopia Gabon Gambia Ghana Guinea Guinea\ Bissau Kenya Lesotho Liberia Libya Madagascar Malawi Mali Mauritania Mauritius Morocco Mayotte Mozambique Namibia Niger Nigeria Rwanda Reunion Sao\ Tome\ And\ Principe Senegal Seychelles Sierra\ Leone Somalia South\ Africa South\ Sudan Sudan Eswatini Tanzania Togo Tunisia Uganda Western\ Sahara Zambia Zimbabwe Afghanistan Armenia Azerbaijan Bahrain Bangladesh Bhutan Brunei Cambodia China East\ Timor India Indonesia Iran Iraq Israel Japan Jordan Kazakhstan Kuwait Kyrgyzstan Laos Lebanon Macau Malaysia Maldives Mongolia Myanmar Nepal North\ Korea Oman Pakistan Palestine Philippines Qatar Saudi\ Arabia Singapore South\ Korea Sri\ Lanka Syria Tajikistan Thailand Turkey Turkmenistan Taiwan United\ Arab\ Emirates Uzbekistan Vietnam Yemen Hong\ Kong Georgia Albania Andorra Austria Belarus Belgium Bosnia\ And\ Herzegovina Bulgaria Croatia Cyprus Czechia Denmark Estonia Finland Germany Greece Hungary Iceland Ireland Italy Kosovo Latvia Liechtenstein Lithuania Luxembourg North\ Macedonia Malta Moldova Monaco Montenegro Netherlands Norway Poland Portugal Romania Russia San\ Marino Serbia Slovakia Slovenia France Spain Sweden Switzerland Ukraine United\ Kingdom Vatican\ City Faroe\ Islands Isle\ Of\ Man Gibraltar Anguilla Antigua\ And\ Barbuda Bahamas Belize Bermuda Barbados British\ Virgin\ Islands Cayman\ Islands Canada Costa\ Rica Cuba Dominica Dominican\ Republic El\ Salvador Grenada Greenland Guatemala Guadeloupe Haiti Honduras Jamaica Martinique Mexico Montserrat Nicaragua Panama Puerto\ Rico Saint\ Barthelemy Saint\ Kitts\ And\ Nevis Saint\ Lucia Sint\ Maarten Saint\ Martin Saint\ Pierre\ And\ Miquelon Saint\ Vincent\ And\ The\ Grenadines Turks\ And\ Caicos\ Islands United\ States Us\ Virgin\ Islands Argentina Bolivia Brazil Chile Colombia Ecuador Falkland\ Islands French\ Guiana Guyana Peru Paraguay Trinidad\ And\ Tobago Uruguay Suriname Venezuela Curacao Aruba Australia Fiji New\ Zealand Micronesia Kiribati Marshall\ Islands Nauru Palau Papua\ New\ Guinea Samoa Solomon\ Islands Tonga Tuvalu Vanuatu Timor\ Leste New\ Caledonia French\ Polynesia Cook\ Islands Wallis\ And\ Futuna Niue Tokelau Northern\ Mariana\ Islands Guam)' \
'(-b --branch -p --protocol -C --continent -c --country)--continent_value=[]: :(None Europe Asia Oceania Africa North\ America South\ America)' \
'(-b --branch -p --protocol -C --continent -c --country)*--protocol_value=[]: :(None Http Https Ftp Ftps)' \
'-c[Set a list of countries to filter with]' \
'--country[Set a list of countries to filter with]' \
'-C[Set a continent to filter with]' \
'--continent[Set a continent to filter with]' \
'-p[Set a list of protocols to filter with]' \
'--protocol[Set a list of protocols to filter with]' \
'-b[Set a branch to filter with]' \
'--branch[Set a branch to filter with]' \
'(-b --branch -p --protocol -C --continent -c --country --branch_value --country_value --continent_value --protocol_value)-s[Set all settings options]' \
'(-b --branch -p --protocol -C --continent -c --country --branch_value --country_value --continent_value --protocol_value)--setup[Set all settings options]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
":: :_shiny-mirrors__config_commands" \
"*::: :->config" \
&& ret=0
case $state in
    (config)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:shiny-mirrors-config-command-$line[1]:"
        case $line[1] in
            (show)
_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
;;
(refresh)
_arguments "${_arguments_options[@]}" \
'-m+[Maximum of mirrors to write to local mirror list]' \
'--max=[Maximum of mirrors to write to local mirror list]' \
'-t+[Time before a benchmark of each mirror timeouts (Seconds, Float)]' \
'--timeout=[Time before a benchmark of each mirror timeouts (Seconds, Float)]' \
'-l+[Maximum last sync duration (Hours, Int)]' \
'--last_sync=[Maximum last sync duration (Hours, Int)]' \
'-f+[Size of a file the speed measured is with]: :(Big Medium Small)' \
'--file_size=[Size of a file the speed measured is with]: :(Big Medium Small)' \
'-p+[Which IP version the mirror has to support (SLOW)]: :(IPv4 IPv6)' \
'--ipv=[Which IP version the mirror has to support (SLOW)]: :(IPv4 IPv6)' \
'-M+[If to measure only transfer time or total time]: :(Total Transfer)' \
'--measure_method=[If to measure only transfer time or total time]: :(Total Transfer)' \
'-L+[Rank only N most recently synced mirrors]' \
'--limit=[Rank only N most recently synced mirrors]' \
'-u[Find mirrors which are uptodate, ignore max last sync]' \
'--updated_only[Find mirrors which are uptodate, ignore max last sync]' \
'-d[Don'\''t actually write the found mirrors to a local mirror list]' \
'--dry_run[Don'\''t actually write the found mirrors to a local mirror list]' \
'-i[Interactively select which mirrors you want to write to local mirror list]' \
'--interactive[Interactively select which mirrors you want to write to local mirror list]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(status)
_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[_shiny-mirrors_commands] )) ||
_shiny-mirrors_commands() {
    local commands; commands=(
        "config:Settings manipulation and magic" \
"refresh:Get the perfect mirrors for you" \
"status:Show status of mirrors you are using" \
"help:Prints this message or the help of the given subcommand(s)" \
    )
    _describe -t commands 'shiny-mirrors commands' commands "$@"
}
(( $+functions[_conf_commands] )) ||
_conf_commands() {
    local commands; commands=(
        "show:Show the settings" \
"help:Prints this message or the help of the given subcommand(s)" \
    )
    _describe -t commands 'conf commands' commands "$@"
}
(( $+functions[_shiny-mirrors__config_commands] )) ||
_shiny-mirrors__config_commands() {
    local commands; commands=(
        "show:Show the settings" \
"help:Prints this message or the help of the given subcommand(s)" \
    )
    _describe -t commands 'shiny-mirrors config commands' commands "$@"
}
(( $+functions[_shiny-mirrors__config__help_commands] )) ||
_shiny-mirrors__config__help_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'shiny-mirrors config help commands' commands "$@"
}
(( $+functions[_shiny-mirrors__help_commands] )) ||
_shiny-mirrors__help_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'shiny-mirrors help commands' commands "$@"
}
(( $+functions[_shiny-mirrors__refresh_commands] )) ||
_shiny-mirrors__refresh_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'shiny-mirrors refresh commands' commands "$@"
}
(( $+functions[_shiny-mirrors__config__show_commands] )) ||
_shiny-mirrors__config__show_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'shiny-mirrors config show commands' commands "$@"
}
(( $+functions[_shiny-mirrors__status_commands] )) ||
_shiny-mirrors__status_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'shiny-mirrors status commands' commands "$@"
}

_shiny-mirrors "$@"