From 95da13122697452d1d55372662aaa590ea5524bb Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Wed, 7 Feb 2024 11:31:06 +0100 Subject: introducing the -u option --- rpt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rpt.c b/rpt.c index 8966faf..409a8cc 100644 --- a/rpt.c +++ b/rpt.c @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -58,6 +59,7 @@ print_help() printf(" -f\t\tDo not exit if one process fails.\n"); printf(" -h\t\tPrint this message and exit.\n"); printf(" -v\t\tPrint the version number and exit.\n"); + printf(" -u\t\tRun COMMAND until it fails.\n"); printf("Reapeat is licensed under the GPL3 license.\n"); } @@ -200,7 +202,7 @@ main(int argc, char* argv[]) void (*handle_error_f)(int status) = exit_on_error; - while ((opt = getopt(argc, argv, ":n:fVh")) != -1) + while ((opt = getopt(argc, argv, ":n:fuhV")) != -1) { switch(opt) { @@ -210,6 +212,9 @@ main(int argc, char* argv[]) case 'f': handle_error_f = continue_on_error; break; + case 'u': + count = LONG_MAX; + break; case 'h': print_help(); exit(EXIT_SUCCESS); -- cgit v1.2.3