From 798827c895a585f284842f6b99378be19c821263 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 23 Jan 2013 18:11:48 -0700 Subject: [PATCH] init: complain on unrecognized option with builtin getopt_long_only() It returns '?' for a bad option, whereas the glibc one does not. Catch that so we behave identically. Signed-off-by: Jens Axboe --- init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.c b/init.c index d22ed5fd..fca74fe2 100644 --- a/init.c +++ b/init.c @@ -1641,6 +1641,9 @@ int parse_cmd_line(int argc, char *argv[]) do_exit++; exit_val = fio_monotonic_clocktest(); break; + case '?': + log_err("%s: unrecognized option '%s'\n", argv[0], + argv[optind - 1]); default: do_exit++; exit_val = 1; -- 2.25.1