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

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