From 5712785e38665f9c4a73cff482d56b1829e93e68 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sat, 3 Oct 2020 15:59:40 +0200 Subject: [PATCH] Show usage and exit non-zero for unsupported option in gvedit Towards https://gitlab.com/graphviz/graphviz/-/issues/1843. --- cmd/gvedit/main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/gvedit/main.cpp b/cmd/gvedit/main.cpp index 0901e5e3a..b10624ab4 100644 --- a/cmd/gvedit/main.cpp +++ b/cmd/gvedit/main.cpp @@ -68,9 +68,11 @@ static char **parseArgs(int argc, char *argv[]) case '?': if (optopt == '\0') usage(0); - else + else { errout << cmd << " : option -" << ((char) optopt) << - " unrecognized - ignored\n" << flush; + " unrecognized\n" << flush; + usage(1); + } break; } } -- 2.40.0