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

index 9ce50baff2f02869f7863c801f594a6cdcad9d70..0bf67c189b26f12b37999546e0b417e049c06981 100644 (file)
@@ -423,10 +423,12 @@ static void init(int argc, char **argv, parms_t * p)
        case '?':
            if (optopt == '?')
                usage(0);
-           else
+           else {
                fprintf(stderr,
-                       "%s: option -%c unrecognized - ignored\n", cmd,
+                       "%s: option -%c unrecognized\n", cmd,
                        optopt);
+               usage(1);
+           }
            break;
        }
     }