From: Magnus Jacobsson Date: Tue, 20 Oct 2020 06:31:02 +0000 (+0200) Subject: Fix gvcolor -? to actually print usage instead of error on macOS X-Git-Tag: 2.46.0~20^2^2~15^2~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5c0b496f214859fb0dfab5e0860bf34b51043f3f;p=graphviz Fix gvcolor -? to actually print usage instead of error on macOS Towards https://gitlab.com/graphviz/graphviz/-/issues/1852. --- diff --git a/cmd/tools/gvcolor.c b/cmd/tools/gvcolor.c index e73bf9cad..62c55507e 100644 --- a/cmd/tools/gvcolor.c +++ b/cmd/tools/gvcolor.c @@ -91,7 +91,7 @@ static void init(int argc, char *argv[]) while ((c = getopt(argc, argv, ":?")) != -1) { switch (c) { case '?': - if (optopt == '\0') + if (optopt == '\0' || optopt == '?') usage(0); else { fprintf(stderr, "gvcolor: option -%c unrecognized\n",