summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-02-11 16:28:12 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-02-11 16:28:12 -0800
commitc3f4b549c080a400f2fd2cb8daa8702f7f287e21 (patch)
tree17c5193c43618505bb9489b0d05074fce43b4c8f
parentf22538b6e6b2a44f87ad7e6a9e39712f5f58d39e (diff)
Print which arguments were unknown before giving usage message
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--init.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/init.c b/init.c
index 736b865..0b6af54 100644
--- a/init.c
+++ b/init.c
@@ -373,7 +373,14 @@ void InitializeWorld(int argc, char **argv)
&argc, argv, FallbackResources,
sessionShellWidgetClass,
shell_args, XtNumber(shell_args));
- if (argc > 1) Syntax(progName);
+ if (argc > 1) {
+ fputs("Unknown argument(s):", stderr);
+ for (int n = 1; n < argc; n++) {
+ fprintf(stderr, " %s", argv[n]);
+ }
+ fputs("\n\n", stderr);
+ Syntax(progName);
+ }
XSetIOErrorHandler(_IOErrorHandler);