From 3f09f6c5771cfc70ab73ce301da683c3884cabd1 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Wed, 8 Feb 2023 15:09:58 -0800 Subject: Print which argument was unknown before giving usage message Signed-off-by: Alan Coopersmith --- listres.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/listres.c b/listres.c index 5f9c348..2b73181 100644 --- a/listres.c +++ b/listres.c @@ -262,13 +262,18 @@ main (int argc, char **argv) (Bool) options.show_superclass, (Bool) options.show_variable); } - } else + } else { + fprintf(stderr, "Unknown argument: %s\n", argv[0]); usage(); + } } else { for (; argc > 0; argc--, argv++) { XmuWidgetNode *node; - if (argv[0][0] == '-') usage (); + if (argv[0][0] == '-') { + fprintf(stderr, "Unknown argument: %s\n", argv[0]); + usage(); + } node = XmuWnNameToNode (widget_list, nwidgets, *argv); if (!node) { fprintf (stderr, "%s: unable to find widget \"%s\"\n", -- cgit v1.2.3