summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-02-11 15:59:10 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-02-11 15:59:10 -0800
commita221346284192af4784a1140aef9f72e72e1167f (patch)
tree6097345e7fb98475e0c7f7dd6c4d3a143fd43da6
parent52d1690c3e1291f7d7be6b4cc39925e3fe4381e3 (diff)
Print which arguments were unknown before giving usage message
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xmessage.c5
1 files changed, 5 insertions, 0 deletions
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);
}