From: Magnus Jacobsson Date: Fri, 2 Oct 2020 12:56:10 +0000 (+0200) Subject: Show usage and exit non-zero for unsupported option in edgepaint X-Git-Tag: 2.46.0~20^2^2~47^2~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=481c59dfad9dc6fb29eaf338d357d28ce0a4a98f;p=graphviz Show usage and exit non-zero for unsupported option in edgepaint Towards https://gitlab.com/graphviz/graphviz/-/issues/1843. --- diff --git a/cmd/edgepaint/edgepaintmain.c b/cmd/edgepaint/edgepaintmain.c index af63bb994..18ab2ec58 100644 --- a/cmd/edgepaint/edgepaintmain.c +++ b/cmd/edgepaint/edgepaintmain.c @@ -182,9 +182,11 @@ static void init(int argc, char *argv[], real *angle, real *accuracy, char **inf case '?': if (optopt == '\0') usage(cmd, 0); - else - fprintf(stderr, "option -%c unrecognized - ignored\n", + else { + fprintf(stderr, "option -%c unrecognized\n", optopt); + usage(cmd, 1); + } break; } }