From: Magnus Jacobsson Date: Fri, 2 Oct 2020 12:57:42 +0000 (+0200) Subject: Show usage and exit non-zero for unsupported option in gc X-Git-Tag: 2.46.0~20^2^2~47^2~34 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f228676966ca3208a5d07050e7cef51079cd1025;p=graphviz Show usage and exit non-zero for unsupported option in gc Towards https://gitlab.com/graphviz/graphviz/-/issues/1843. --- 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; } }