Fix ccomps -? to actually print usage instead of error on macOS
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Tue, 20 Oct 2020 06:11:33 +0000 (08:11 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Sat, 24 Oct 2020 05:46:23 +0000 (07:46 +0200)
Towards https://gitlab.com/graphviz/graphviz/-/issues/1852

cmd/tools/ccomps.c

index 68f638997a0079f6d91204966a08e3291f3892aa..270df8d39079459928a4febe69be71ffafed3fbe 100644 (file)
@@ -205,7 +205,7 @@ static void init(int argc, char *argv[])
                "ccomps: option -%c missing argument - ignored\n", optopt);
            break;
        case '?':
-           if (optopt == '\0')
+           if (optopt == '\0' || optopt == '?')
                usage(0);
            else {
                fprintf(stderr,