diff options
author | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-02-07 11:31:06 +0100 |
---|---|---|
committer | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-02-07 11:31:06 +0100 |
commit | 95da13122697452d1d55372662aaa590ea5524bb (patch) | |
tree | 0b61b3c63490815c516fde640a1fd34d83441be0 | |
parent | 15b51b0c0ac518bb6a60ffd1fc389262eae99908 (diff) |
introducing the -u option
-rw-r--r-- | rpt.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -18,6 +18,7 @@ #include <errno.h> #include <fcntl.h> +#include <limits.h> #include <poll.h> #include <stdio.h> #include <stdlib.h> @@ -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); |