From 481c59dfad9dc6fb29eaf338d357d28ce0a4a98f Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Fri, 2 Oct 2020 14:56:10 +0200 Subject: [PATCH] Show usage and exit non-zero for unsupported option in edgepaint Towards https://gitlab.com/graphviz/graphviz/-/issues/1843. --- cmd/edgepaint/edgepaintmain.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; } } -- 2.50.1