diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -54,7 +54,7 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); while (1) { - val = getopt_long(argc, argv, "n:r::d", tip_repo_opts, NULL); + val = getopt_long(argc, argv, "n:t:r::d", tip_repo_opts, NULL); if (val < 0) break; @@ -67,16 +67,18 @@ int main(int argc, char *argv[]) } break; case 'r': - if (optind < argc && + if (optarg) { + max_redirect = atoi(optarg); + } else if (optind < argc && argv[optind][0] != '-') { max_redirect = atoi(argv[optind++]); - if (max_redirect < 0) { - syslog(LOG_ERR, "Invalid number for redirections"); - return EXIT_FAILURE; - } } else { max_redirect = max_clients; } + if (max_redirect < 0) { + syslog(LOG_ERR, "Invalid number for redirections"); + return EXIT_FAILURE; + } break; case 't': root = strdup(optarg); |