From: Magnus Jacobsson Date: Sat, 3 Oct 2020 14:03:50 +0000 (+0200) Subject: Show usage and exit non-zero for unsupported option in mm2gv X-Git-Tag: 2.46.0~20^2^2~47^2~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=41847dc697f2054ff0df093af1a3b36bd943a195;p=graphviz Show usage and exit non-zero for unsupported option in mm2gv Towards https://gitlab.com/graphviz/graphviz/-/issues/1843. --- diff --git a/cmd/tools/mm2gv.c b/cmd/tools/mm2gv.c index 9ce50baff..0bf67c189 100644 --- a/cmd/tools/mm2gv.c +++ b/cmd/tools/mm2gv.c @@ -423,10 +423,12 @@ static void init(int argc, char **argv, parms_t * p) case '?': if (optopt == '?') usage(0); - else + else { fprintf(stderr, - "%s: option -%c unrecognized - ignored\n", cmd, + "%s: option -%c unrecognized\n", cmd, optopt); + usage(1); + } break; } }