From: Magnus Jacobsson Date: Sat, 3 Oct 2020 14:02:09 +0000 (+0200) Subject: Show usage and exit non-zero for unsupported option in lefty X-Git-Tag: 2.46.0~20^2^2~47^2~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=31c4b42eadd54d2285d9d0017a65d90a2be80d03;p=graphviz Show usage and exit non-zero for unsupported option in lefty Towards https://gitlab.com/graphviz/graphviz/-/issues/1843. --- diff --git a/cmd/lefty/lefty.c b/cmd/lefty/lefty.c index e49eaa7ac..25cf1eccd 100644 --- a/cmd/lefty/lefty.c +++ b/cmd/lefty/lefty.c @@ -471,7 +471,8 @@ static void processargs (int argc, char *argv[]) { fclose(fp); fp = stdin; } else if (argv[0][0] == '-') { - fprintf (stderr, "option %s unrecognized - ignored\n", argv[0]); + fprintf (stderr, "option %s unrecognized\n", argv[0]); + usage(1); } else { if (fp != NULL && fp != stdin)