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

lib/pack/ptest.c

index fb3deddf4c9bf09b9636cc0e2e6849851efec777..83d9a3d074f4b79eab0f8fa6490ccdaa2881d747 100644 (file)
@@ -86,9 +86,11 @@ static void init(int argc, char *argv[])
        case '?':
            if (optopt == '?')
                usage(0);
-           else
+           else {
                fprintf(stderr,
-                       "ptest: option -%c unrecognized - ignored\n", c);
+                       "ptest: option -%c unrecognized\n", c);
+               usage(1);
+           }
            break;
        }
     }