]> granicus.if.org Git - graphviz/commitdiff
Fix gvcolor -? to actually print usage instead of error on macOS
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Tue, 20 Oct 2020 06:31:02 +0000 (08:31 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Sat, 24 Oct 2020 05:46:24 +0000 (07:46 +0200)
Towards https://gitlab.com/graphviz/graphviz/-/issues/1852.

cmd/tools/gvcolor.c

index e73bf9cad66a4feebbd39c5babd7cdb2704ded5c..62c55507eaa6b70dc4902f55f3abf50e0f204109 100644 (file)
@@ -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",