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

index a96053735a3569d3c9ff783b21055fd0083a3ac3..386b1f23d4aafd24d4c38f125e7aa80eb25f96ec 100644 (file)
@@ -259,9 +259,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;
        }
     }