From a221346284192af4784a1140aef9f72e72e1167f Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 11 Feb 2023 15:59:10 -0800 Subject: Print which arguments were unknown before giving usage message Signed-off-by: Alan Coopersmith --- xmessage.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xmessage.c b/xmessage.c index 6f31007..a1082e6 100644 --- a/xmessage.c +++ b/xmessage.c @@ -349,6 +349,11 @@ main (int argc, char *argv[]) } message_len = len; } else { + fputs("Unknown argument(s):", stderr); + for (int n = 1; n < argc; n++) { + fprintf(stderr, " %s", argv[n]); + } + fputs("\n\n", stderr); usage(stderr); exit(1); } -- cgit v1.2.3