]> granicus.if.org Git - graphviz/commitdiff
Show usage and exit non-zero for unsupported option in sccmap
authorMagnus Jacobsson <magnus.jacobsson@berotec.se>
Sat, 3 Oct 2020 14:04:22 +0000 (16:04 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Thu, 8 Oct 2020 19:10:25 +0000 (21:10 +0200)
Towards https://gitlab.com/graphviz/graphviz/-/issues/1843.

doc/libgraph/sccmap.c

index 6808462b64be67de478fd377a4ad99271db84981..0c37efc2ea8dfc979164bf348d2dd2dbc132b87d 100644 (file)
@@ -313,9 +313,11 @@ static void scanArgs(int argc, char **argv)
                case '?':
                        if (optopt == '?')
                                usage(0);
-                       else
-                               fprintf(stderr, "%s: option -%c unrecognized - ignored\n",
+                       else {
+                               fprintf(stderr, "%s: option -%c unrecognized\n",
                                                CmdName, optopt);
+                               usage(1);
+                       }
                        break;
                }
        }