diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-02-10 11:51:01 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-02-10 11:53:18 -0800 |
commit | f30ef4e0f3e464f6304bdc85d28ebec0c2ba5e4f (patch) | |
tree | 0176d3a67ef3897012a165b6abbdebd39f0596c3 /xeyes.c | |
parent | e7a54da926969631340942c5f850dd196a0df97b (diff) |
Print which argument was unknown before giving usage message
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'xeyes.c')
-rw-r--r-- | xeyes.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -131,8 +131,17 @@ main(int argc, char **argv) toplevel = XtAppInitialize(&app_context, "XEyes", options, XtNumber(options), &argc, argv, NULL, arg, (Cardinal) 0); - if (argc != 1) + + if (argc != 1) { + fputs("Unknown argument(s):", stderr); + for (int n = 1; n < argc; n++) { + if ((n < (argc -1)) || (argv[n][0] == '-')) { + fprintf(stderr, " %s", argv[n]); + } + } + fputs("\n\n", stderr); usage(1); + } wm_delete_window = XInternAtom(XtDisplay(toplevel), "WM_DELETE_WINDOW", False); |