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

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