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

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