diff --git a/gget.c b/gget.c index 49fab52..db18bf0 100644 --- a/gget.c +++ b/gget.c @@ -512,23 +512,8 @@ int main(int argc, char** argv) int continuous_mode=0; int exists; - while ((opt = getopt(argc, argv, "hn:l:o:u:qm:")) != -1) { + while ((opt = getopt(argc, argv, "hl:m:n:o:qu:")) != -1) { switch (opt) { - case 'n': - nb_threads = strtoul(optarg, &endptr, 0); - if (*endptr) - { - usage(argv[0]); - return 1; - } - if (nb_threads == 0) - nb_threads = DEFAULT_NB_THREADS; - else if (nb_threads > MAX_NB_THREADS) - { - printf("Max numberb of threads is %d\n", MAX_NB_THREADS); - nb_threads = MAX_NB_THREADS; - } - break; case 'l': max_speed = strtoul(optarg, &endptr, 0); if (*endptr) @@ -570,15 +555,30 @@ int main(int argc, char** argv) } max_chunk_size *= multiplier; break; + case 'n': + nb_threads = strtoul(optarg, &endptr, 0); + if (*endptr) + { + usage(argv[0]); + return 1; + } + if (nb_threads == 0) + nb_threads = DEFAULT_NB_THREADS; + else if (nb_threads > MAX_NB_THREADS) + { + printf("Max numberb of threads is %d\n", MAX_NB_THREADS); + nb_threads = MAX_NB_THREADS; + } + break; case 'o': out_filename = strdup(optarg); break; - case 'u': - user_agent = strdup(optarg); - break; case 'q': quiet = 1; break; + case 'u': + user_agent = strdup(optarg); + break; default: case 'h': usage(argv[0]);