From: Jérôme Benoit Date: Thu, 30 Nov 2017 20:27:30 +0000 (+0100) Subject: print usage message if options are invalid. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=5c1346dd169a32638aa70812aee0fc0dea3ccb70;p=TP_AL_C.git print usage message if options are invalid. Signed-off-by: Jérôme Benoit --- 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; } }