]> granicus.if.org Git - graphviz/commitdiff
Show usage and exit non-zero for unsupported option in bcomps
authorMagnus Jacobsson <magnus.jacobsson@berotec.se>
Fri, 2 Oct 2020 12:23:00 +0000 (14:23 +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/bcomps.c

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