From 74bbafefd2945e17b917283ed3aa0e9b7e3d3869 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Fri, 2 Oct 2020 14:26:09 +0200 Subject: [PATCH] Show usage and exit non-zero for unsupported option in ccomps Towards https://gitlab.com/graphviz/graphviz/-/issues/1843. --- cmd/tools/ccomps.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/tools/ccomps.c b/cmd/tools/ccomps.c index 4fded3dd2..8cedc8a66 100644 --- a/cmd/tools/ccomps.c +++ b/cmd/tools/ccomps.c @@ -207,9 +207,11 @@ static void init(int argc, char *argv[]) case '?': if (optopt == '?') usage(0); - else + else { fprintf(stderr, - "ccomps: option -%c unrecognized - ignored\n", optopt); + "ccomps: option -%c unrecognized\n", optopt); + usage(1); + } break; } } -- 2.40.0