]> granicus.if.org Git - graphviz/commitdiff
Show usage and exit non-zero for unsupported option in tred2
authorMagnus Jacobsson <magnus.jacobsson@berotec.se>
Sat, 3 Oct 2020 14:04:07 +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.

cmd/tools/tred2.c

index 14f2578f3b3db616e305d60688e2bc3c5afd3692..297c1d9dbc82476de1d67149fea0a6d600ee4b72 100644 (file)
@@ -65,9 +65,11 @@ static void init(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;
        }
     }