From: Jens Axboe Date: Thu, 24 Jan 2013 01:11:48 +0000 (-0700) Subject: init: complain on unrecognized option with builtin getopt_long_only() X-Git-Tag: fio-2.0.14~87 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=798827c895a585f284842f6b99378be19c821263;p=fio.git 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 --- 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;