diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-02-11 10:40:16 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-02-11 10:40:16 -0800 |
commit | 9079fc7a7138aaaae6a4bc99e97c8eb073875a93 (patch) | |
tree | 37826e5ea9029974326c44b44192af4daeea380f | |
parent | a70254dac5e63fbe4f8aa89433189a613a509e1f (diff) |
Print which argument(s) was unknown before giving usage message
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | xfd.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -194,6 +194,15 @@ main(int argc, char *argv[]) xfd_options, XtNumber(xfd_options), &argc, argv, NULL, NULL, 0); + 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 (); + } + #ifdef USE_GETTEXT { const char *domaindir; @@ -214,7 +223,6 @@ main(int argc, char *argv[]) Resources[3].default_addr = gettext(DEF_START_FORMAT); Resources[4].default_addr = gettext(DEF_NOCHAR_FORMAT); - if (argc != 1) usage (); XtAppAddActions (xtcontext, xfd_actions, XtNumber (xfd_actions)); XtOverrideTranslations (toplevel, XtParseTranslationTable ("<Message>WM_PROTOCOLS: Quit()")); |