From 85cd7635895c2df5d46217510258ff4c198ab8d1 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Fri, 2 Oct 2020 14:59:11 +0200 Subject: [PATCH] Show usage and exit non-zero for unsupported option in gvcolor Towards https://gitlab.com/graphviz/graphviz/-/issues/1843. --- cmd/tools/gvcolor.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/tools/gvcolor.c b/cmd/tools/gvcolor.c index 9652749f8..d1320a2aa 100644 --- a/cmd/tools/gvcolor.c +++ b/cmd/tools/gvcolor.c @@ -93,9 +93,11 @@ static void init(int argc, char *argv[]) case '?': if (optopt == '?') usage(0); - else - fprintf(stderr, "gvcolor: option -%c unrecognized - ignored\n", + else { + fprintf(stderr, "gvcolor: option -%c unrecognized\n", optopt); + usage(1); + } break; } } -- 2.40.0