]> granicus.if.org Git - graphviz/commitdiff
Show usage and exit non-zero for unsupported option in gc
authorMagnus Jacobsson <magnus.jacobsson@berotec.se>
Fri, 2 Oct 2020 12:57:42 +0000 (14:57 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Thu, 8 Oct 2020 19:10:24 +0000 (21:10 +0200)
Towards https://gitlab.com/graphviz/graphviz/-/issues/1843.

cmd/tools/gc.c

index 5b9e8e7834c3648ba2c2aa2c8cf6952a02db49eb..840fbb5f6100383cdbf7574caf0fea2b73be5429 100644 (file)
@@ -125,9 +125,11 @@ static void init(int argc, char *argv[])
        case '?':
            if (optopt == '?')
                usage(0);
-           else
-               fprintf(stderr, "gc: option -%c unrecognized - ignored\n",
+           else {
+               fprintf(stderr, "gc: option -%c unrecognized\n",
                        optopt);
+               usage(1);
+           }
            break;
        }
     }