From: Magnus Jacobsson Date: Fri, 2 Oct 2020 12:59:11 +0000 (+0200) Subject: Show usage and exit non-zero for unsupported option in gvcolor X-Git-Tag: 2.46.0~20^2^2~47^2~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=85cd7635895c2df5d46217510258ff4c198ab8d1;p=graphviz Show usage and exit non-zero for unsupported option in gvcolor Towards https://gitlab.com/graphviz/graphviz/-/issues/1843. --- diff --git a/cmd/tools/gvcolor.c b/cmd/tools/gvcolor.c index 9652749f8..d1320a2aa 100644 --- a/cmd/tools/gvcolor.c +++ b/cmd/tools/gvcolor.c @@ -93,9 +93,11 @@ static void init(int argc, char *argv[]) case '?': if (optopt == '?') usage(0); - else - fprintf(stderr, "gvcolor: option -%c unrecognized - ignored\n", + else { + fprintf(stderr, "gvcolor: option -%c unrecognized\n", optopt); + usage(1); + } break; } }