aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Riehs <tristan.riehs@bordeaux-inp.fr>2024-02-07 11:34:26 +0100
committerTristan Riehs <tristan.riehs@bordeaux-inp.fr>2024-02-07 11:34:26 +0100
commitf3b3ba220e14b1b5fe39f14d7e0f04c4713e10b5 (patch)
tree53906d95d5e21e2f0f69f08580021986171851df
parent95da13122697452d1d55372662aaa590ea5524bb (diff)
check for conflicting options added
-rw-r--r--rpt.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/rpt.c b/rpt.c
index 409a8cc..b35f492 100644
--- a/rpt.c
+++ b/rpt.c
@@ -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;