]> granicus.if.org Git - graphviz/commitdiff
Fix edgepaint -? to actually print usage instead of error
authorMagnus Jacobsson <magnus.jacobsson@berotec.se>
Fri, 25 Sep 2020 06:38:33 +0000 (08:38 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Fri, 2 Oct 2020 12:50:35 +0000 (14:50 +0200)
cmd/edgepaint/edgepaintmain.c

index 99aa94522938b13e49c828d6c6a8506169aa676d..2a42742f4370a09c5319453fc499ddffc0100be5 100644 (file)
@@ -114,7 +114,7 @@ static void init(int argc, char *argv[], real *angle, real *accuracy, char **inf
   *color_scheme = "lab";
   *lightness = NULL;
 
-  while ((c = getopt(argc, argv, ":vc:a:s:r:l:o:")) != -1) {
+  while ((c = getopt(argc, argv, ":vc:a:s:r:l:o:?")) != -1) {
     switch (c) {
     case 's':
       *check_edges_with_same_endpoint = 1;
@@ -179,8 +179,14 @@ static void init(int argc, char *argv[], real *angle, real *accuracy, char **inf
         fclose(outfile);
       outfile = openFile(optarg, "w", CmdName);
       break;
-    default:
+    case '?':
+// FIXME: Remove the Windows specific condition when
+// https://gitlab.com/graphviz/graphviz/-/issues/1820 is resolved.
+#ifdef _WIN32
       if (optopt == '?')
+#else
+      if (optopt == '\0')
+#endif
        usage(cmd, 0);
       else
        fprintf(stderr, "option -%c unrecognized - ignored\n",