]> granicus.if.org Git - graphviz/commitdiff
Show usage and exit non-zero for unsupported option in gvpack
authorMagnus Jacobsson <magnus.jacobsson@berotec.se>
Fri, 2 Oct 2020 13:12:07 +0000 (15:12 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Thu, 8 Oct 2020 19:10:24 +0000 (21:10 +0200)
Towards https://gitlab.com/graphviz/graphviz/-/issues/1843.

cmd/tools/gvpack.c

index 598d838bf9e5f99184111ffceb1074893a51d897..b2de4bdd7d81f69a04aa80ee8914ff45abcde464 100644 (file)
@@ -245,9 +245,11 @@ static void init(int argc, char *argv[], pack_info* pinfo)
        case '?':
            if (optopt == '?')
                usage(0);
-           else
+           else {
                fprintf(stderr,
-                       "gvpack: option -%c unrecognized - ignored\n", optopt);
+                       "gvpack: option -%c unrecognized\n", optopt);
+               usage(1);
+           }
            break;
        }
     }