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

index ab8fd739c0ce42d690bf3c897d638eb31da65f23..c2403dd219def3af87392e9c4a64bc267b88de43 100644 (file)
@@ -207,8 +207,10 @@ static void init(int argc, char *argv[], opts_t* opts)
                case '?':
                        if (optopt == '?')
                                usage(0);
-                       else
-                               fprintf(stderr, "%s: option -%c unrecognized - ignored\n", cmd, optopt);
+                       else {
+                               fprintf(stderr, "%s: option -%c unrecognized\n", cmd, optopt);
+                               usage(1);
+                       }
                        break;
                default:
                        break;