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