X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xboard.c;h=79b61a29602e4d2f99b69e99dc47040ad61f95c1;hb=a5b8066ad78ddeec1ddcca3b31ee26fe1052fc89;hp=64ac34f1ba90a73f059de0b357a0947b7a1f16fe;hpb=c2221f8b8d4d4850075ea5c770acb51a23154b68;p=xboard.git diff --git a/xboard.c b/xboard.c index 64ac34f..79b61a2 100644 --- a/xboard.c +++ b/xboard.c @@ -2419,25 +2419,35 @@ main(argc, argv) XtAppInitialize(&appContext, "XBoard", shellOptions, XtNumber(shellOptions), &argc, argv, xboardResources, NULL, 0); - if (argc > 1) { + if (argc > 1) + { /* left over command line arguments, print out help and exit. + * Use two columns to print help + */ fprintf(stderr, _("%s: unrecognized argument %s\n"), programName, argv[1]); + fprintf(stderr, "Recognized options:\n"); - for(i = 0; i < XtNumber(shellOptions); i++) { + for(i = 0; i < XtNumber(shellOptions); i++) + { + /* print first column */ j = fprintf(stderr, " %s%s", shellOptions[i].option, (shellOptions[i].argKind == XrmoptionSepArg ? " ARG" : "")); - if (i++ < XtNumber(shellOptions)) { + /* print second column and end line */ + if (++i < XtNumber(shellOptions)) + { fprintf(stderr, "%*c%s%s\n", 40 - j, ' ', shellOptions[i].option, (shellOptions[i].argKind == XrmoptionSepArg ? " ARG" : "")); - } else { + } + else + { fprintf(stderr, "\n"); - } - } + }; + }; exit(2); - } + }; p = getenv("HOME"); if (p == NULL) p = "/tmp";