From 5c1346dd169a32638aa70812aee0fc0dea3ccb70 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 30 Nov 2017 21:27:30 +0100 Subject: [PATCH] print usage message if options are invalid. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- lexer/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lexer/main.c b/lexer/main.c index a187f8e..85adea0 100644 --- a/lexer/main.c +++ b/lexer/main.c @@ -91,6 +91,8 @@ int main(int argc, char **argv) { /* invalid option */ pr_error("%s: option '-%c' is invalid: ignored\n", argv[0], optopt); + /* print the help message for invalid options */ + hflag = 1; break; } } -- 2.34.1