verbose_error_message_about_recognized_options (tiny change from Debian patches)
authorBrian May <>
Sat, 27 Jun 2009 22:47:52 +0000 (15:47 -0700)
committerArun Persaud <arun@nubati.net>
Sat, 27 Jun 2009 22:47:52 +0000 (15:47 -0700)
xboard.c

index d47a15d..489ef64 100644 (file)
--- a/xboard.c
+++ b/xboard.c
@@ -2329,6 +2329,20 @@ main(argc, argv)
     if (argc > 1) {
        fprintf(stderr, _("%s: unrecognized argument %s\n"),
                programName, argv[1]);
+       fprintf(stderr, "Recognized options:\n");
+       for(i = 0; i < XtNumber(shellOptions); i++) {
+           j = fprintf(stderr, "  %s%s", shellOptions[i].option,
+                       (shellOptions[i].argKind == XrmoptionSepArg
+                        ? " ARG" : ""));
+           if (i++ < XtNumber(shellOptions)) {
+               fprintf(stderr, "%*c%s%s\n", 40 - j, ' ',
+                       shellOptions[i].option,
+                       (shellOptions[i].argKind == XrmoptionSepArg
+                        ? " ARG" : ""));
+           } else {
+               fprintf(stderr, "\n");
+           }
+       }
        exit(2);
     }