harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 285c36301efa3a83f3af2a8bd4340eaa4ced95f6
parent f3a64fdf31987686aeaac5411273d9fa1aa27031
Author: Sebastian <sebastian@sebsite.pw>
Date:   Fri, 11 Mar 2022 18:41:48 -0500

main: add -h flag

This prints usage text, but without the "unrecognized option" message.

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Msrc/main.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main.c b/src/main.c @@ -98,7 +98,7 @@ main(int argc, char *argv[]) struct define *defines = NULL, *def; int c; - while ((c = getopt(argc, argv, "D:o:Tt:N:")) != -1) { + while ((c = getopt(argc, argv, "D:ho:Tt:N:")) != -1) { switch (c) { case 'D': def = parse_define(argv[0], optarg); @@ -121,6 +121,7 @@ main(int argc, char *argv[]) parse_identifier(&lexer, unit.ns, false); lex_finish(&lexer); break; + case 'h': default: usage(argv[0]); return EXIT_FAILURE;