From 8a84376a14488cf9e8cbbbae162bb782a6d378b9 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sat, 3 Oct 2020 16:03:37 +0200 Subject: [PATCH] Show usage and exit non-zero for unsupported option in dijkstra Towards https://gitlab.com/graphviz/graphviz/-/issues/1843. --- cmd/tools/dijkstra.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/tools/dijkstra.c b/cmd/tools/dijkstra.c index 8269b9afd..ba12bc7ba 100644 --- a/cmd/tools/dijkstra.c +++ b/cmd/tools/dijkstra.c @@ -263,9 +263,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