From: Magnus Jacobsson Date: Fri, 2 Oct 2020 13:19:43 +0000 (+0200) Subject: Show usage and exit non-zero for unsupported option in nop X-Git-Tag: 2.46.0~20^2^2~47^2~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ca4b8979b1aeeefbf785a6141761aea26be58451;p=graphviz Show usage and exit non-zero for unsupported option in nop Towards https://gitlab.com/graphviz/graphviz/-/issues/1843. --- 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; } }