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