diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-02-09 18:26:14 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-02-09 18:26:14 -0800 |
commit | 1293789eca465dfec7c5874b65cafb70c4f90125 (patch) | |
tree | 8bdee06af2d76c42cf9679e54a4c12891c9e755f /xditview.c | |
parent | 543f75af78446d6456fab89233ae1ab8eaf4c223 (diff) |
Print which argument was unknown before giving usage message
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'xditview.c')
-rw-r--r-- | xditview.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -170,8 +170,16 @@ main(int argc, char **argv) toplevel = XtAppInitialize(&xtcontext, "Xditview", options, XtNumber(options), &argc, argv, NULL, NULL, 0); - if (argc > 2) + if (argc > 2) { + 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); Syntax(argv[0]); + } XtAppAddActions(xtcontext, xditview_actions, XtNumber(xditview_actions)); XtOverrideTranslations |