From: Magnus Jacobsson Date: Fri, 2 Oct 2020 13:23:25 +0000 (+0200) Subject: Show usage and exit non-zero for unsupported option in tred X-Git-Tag: 2.46.0~20^2^2~47^2~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b03205870bed8f8015ec3c5c03f90f5e6ce5acd1;p=graphviz Show usage and exit non-zero for unsupported option in tred Towards https://gitlab.com/graphviz/graphviz/-/issues/1843. --- diff --git a/cmd/tools/tred.c b/cmd/tools/tred.c index a96053735..386b1f23d 100644 --- a/cmd/tools/tred.c +++ b/cmd/tools/tred.c @@ -259,9 +259,11 @@ static void init(int argc, char *argv[]) case '?': if (optopt == '?') usage(0); - else - fprintf(stderr, "%s: option -%c unrecognized - ignored\n", + else { + fprintf(stderr, "%s: option -%c unrecognized\n", CmdName, optopt); + usage(1); + } break; } }