From f228676966ca3208a5d07050e7cef51079cd1025 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Fri, 2 Oct 2020 14:57:42 +0200 Subject: [PATCH] Show usage and exit non-zero for unsupported option in gc Towards https://gitlab.com/graphviz/graphviz/-/issues/1843. --- cmd/tools/gc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/tools/gc.c b/cmd/tools/gc.c index 5b9e8e783..840fbb5f6 100644 --- a/cmd/tools/gc.c +++ b/cmd/tools/gc.c @@ -125,9 +125,11 @@ static void init(int argc, char *argv[]) case '?': if (optopt == '?') usage(0); - else - fprintf(stderr, "gc: option -%c unrecognized - ignored\n", + else { + fprintf(stderr, "gc: option -%c unrecognized\n", optopt); + usage(1); + } break; } } -- 2.40.0