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

cmd/tools/sccmap.c

index 6918bf299187f2fdda495d2cacb36f06e7434359..6de217b62d281e7d1f828dadadc780b7ee8f7260 100644 (file)
@@ -365,9 +365,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;
        }
     }