diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-02-08 16:27:13 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-02-08 16:27:13 -0800 |
commit | e43205f548795c2cab5c1f92ca839b72d25f2a10 (patch) | |
tree | c261cea5a52e774e86667641fd343a656e0e1630 | |
parent | a2ca36a770cac1684dc5e39d9b777b1b02c69114 (diff) |
Print which argument was unknown before giving usage message
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | oclock.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -110,7 +110,14 @@ main(int argc, char *argv[]) toplevel = XtOpenApplication(&xtcontext, "Clock", options, XtNumber(options), &argc, argv, NULL, sessionShellWidgetClass, NULL, 0); - if (argc != 1) usage(); + if (argc != 1) { + fputs("Unknown argument(s):", stderr); + for (int n = 1; n < argc; n++) { + fprintf(stderr, " %s", argv[n]); + } + fputs("\n\n", stderr); + usage(); + } XtAddCallback(toplevel, XtNsaveCallback, save, NULL); XtAddCallback(toplevel, XtNdieCallback, die, NULL); |