From: Magnus Jacobsson Date: Fri, 25 Sep 2020 06:38:33 +0000 (+0200) Subject: Fix edgepaint -? to actually print usage instead of error X-Git-Tag: 2.46.0~20^2^2~55^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac80dba8eba1fadc945a3e006fdd9f476ae1d44a;p=graphviz Fix edgepaint -? to actually print usage instead of error --- diff --git a/cmd/edgepaint/edgepaintmain.c b/cmd/edgepaint/edgepaintmain.c index 99aa94522..2a42742f4 100644 --- a/cmd/edgepaint/edgepaintmain.c +++ b/cmd/edgepaint/edgepaintmain.c @@ -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",