From a5b8066ad78ddeec1ddcca3b31ee26fe1052fc89 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Thu, 8 Oct 2009 23:51:06 -0700 Subject: [PATCH] added some comments and formated code --- xboard.c | 24 +++++++++++++++++------- 1 files changed, 17 insertions(+), 7 deletions(-) diff --git a/xboard.c b/xboard.c index 1e0e7a8..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"; -- 1.7.0.4