From: Magnus Jacobsson Date: Sat, 3 Oct 2020 14:03:37 +0000 (+0200) Subject: Show usage and exit non-zero for unsupported option in dijkstra X-Git-Tag: 2.46.0~20^2^2~47^2~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a84376a14488cf9e8cbbbae162bb782a6d378b9;p=graphviz Show usage and exit non-zero for unsupported option in dijkstra Towards https://gitlab.com/graphviz/graphviz/-/issues/1843. --- 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; } }