summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-02-11 12:38:58 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-02-11 12:38:58 -0800
commit7063169a70b6ce49de777f5daa1c256552a9e32a (patch)
treec7e35fa9cdca7f0635bcf1dfe19166f7f1e50b5b
parent8fc5bb64756ffae562032613bd5616481ec67f2d (diff)
Print which arguments were unknown before giving usage message
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xload.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/xload.c b/xload.c
index 4c07102..0559769 100644
--- a/xload.c
+++ b/xload.c
@@ -207,7 +207,14 @@ main(int argc, char **argv)
bindtextdomain("xload", domaindir);
#endif
- if (argc != 1) usage();
+ if (argc != 1) {
+ fputs(gettext("Unknown argument(s):"), stderr);
+ for (int n = 1; n < argc; n++) {
+ fprintf(stderr, " %s", argv[n]);
+ }
+ fputs("\n\n", stderr);
+ usage();
+ }
XtGetApplicationResources( toplevel, (XtPointer) &resources,
my_resources, XtNumber(my_resources),