]> granicus.if.org Git - graphviz/commitdiff
Show usage and exit non-zero for unsupported option in lib/spine/spine.c
authorMagnus Jacobsson <magnus.jacobsson@berotec.se>
Sat, 3 Oct 2020 14:06:06 +0000 (16:06 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Thu, 8 Oct 2020 19:10:25 +0000 (21:10 +0200)
Final commit that fixes
https://gitlab.com/graphviz/graphviz/-/issues/1843.

lib/spine/spine.c

index c1b023fb494c92c34a7622f698d8e00f630cf714..791dc4580df99f78d3ce4878a053c3fff6477bcd 100644 (file)
@@ -634,9 +634,11 @@ static void doOpts(int argc, char *argv[], opts_t * op)
                case '?':
                        if (optopt == '?')
                                usage(cmd, 0);
-                       else
-                               fprintf(stderr, "%s: option -%c unrecognized - ignored\n",
+                       else {
+                               fprintf(stderr, "%s: option -%c unrecognized\n",
                                                cmd, optopt);
+                               usage(cmd, 1);
+                       }
                        break;
                default:
                        break;