Exit on bad command line options
It could be dangerous, eg if you expected --read-only to do its job
when you really needed to type --readonly.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/init.c b/init.c
index f5dff50..e96b410 100644
--- a/init.c
+++ b/init.c
@@ -837,7 +837,7 @@
static int parse_cmd_line(int argc, char *argv[])
{
struct thread_data *td = NULL;
- int c, ini_idx = 0, lidx, ret, dont_add_job = 0;
+ int c, ini_idx = 0, lidx, ret, dont_add_job = 0, bad_options = 0;
while ((c = getopt_long_only(argc, argv, "", long_options, &lidx)) != -1) {
switch (c) {
@@ -914,10 +914,14 @@
break;
}
default:
+ bad_options++;
break;
}
}
+ if (bad_options)
+ exit(1);
+
if (td) {
if (dont_add_job)
put_job(td);