diff options
author | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-02-07 11:34:26 +0100 |
---|---|---|
committer | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-02-07 11:34:26 +0100 |
commit | f3b3ba220e14b1b5fe39f14d7e0f04c4713e10b5 (patch) | |
tree | 53906d95d5e21e2f0f69f08580021986171851df /rpt.c | |
parent | 95da13122697452d1d55372662aaa590ea5524bb (diff) |
check for conflicting options added
Diffstat (limited to 'rpt.c')
-rw-r--r-- | rpt.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -193,6 +193,17 @@ copy_stdin() } } +void +check_u_f_conflict(void (*handle_error_f)(int status), long count) +{ + if ((handle_error_f == continue_on_error) && (count == LONG_MAX)) + { + fprintf(stderr, "rpt: -u and -f options both given, conflict, \ +see man rpt(1)\n"); + exit(EXIT_INVALID_ARG); + } +} + int main(int argc, char* argv[]) { @@ -231,6 +242,8 @@ main(int argc, char* argv[]) } } + check_u_f_conflict(handle_error_f, count); + if (strcount) { char *err = NULL; |