diff options
author | jthorn <jthorn@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2006-06-01 12:38:11 +0000 |
---|---|---|
committer | jthorn <jthorn@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2006-06-01 12:38:11 +0000 |
commit | df8ef497d230fddd1895402549bfaa7b1a2c3244 (patch) | |
tree | 695a05c9e92243ed69fbdd6d6b1a802ffd4eecb0 | |
parent | c5a2f88d8f19db00bfcc20a2c850b3502fe76658 (diff) |
apply patch
http://www.cactuscode.org/old/pipermail/patches/2006-May/000180.html
This documents the 5 (!) separate places in the code which must be changed
to add a new command-line option. See also the discussion in
http://www.cactuscode.org/mailman/private/cactusmaint/2006-May/021429.html
http://www.cactuscode.org/mailman/private/cactusmaint/2006-May/021430.html
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4310 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r-- | src/main/CommandLine.c | 10 | ||||
-rw-r--r-- | src/main/ProcessCommandLine.c | 13 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/main/CommandLine.c b/src/main/CommandLine.c index 93984ab6..4451949c 100644 --- a/src/main/CommandLine.c +++ b/src/main/CommandLine.c @@ -61,6 +61,11 @@ int cctki_onlyprintschedule = 0; /******************************************************************** ********************* Defines ********************** ********************************************************************/ + +/* + * See comments in CCTKi_ProcessCommandLine() for a list of all the + * places you have to update if you add a new command-line option. + */ #define CACTUS_COMMANDLINE_OPTIONS \ "[-h] [-O] [-o paramname] [-L n] [-W n] [-E n] [-r[o|e|oe|eo]] " \ "[-S] [-T] [-t name] [-parameter-level <level>] [-v] " \ @@ -538,6 +543,11 @@ void CCTKi_CommandLineVersion(void) void CCTKi_CommandLineHelp (void) { char **argv; + + /* + * See comments in CCTKi_ProcessCommandLine() for a list of all the + * places you have to update if you add a new command-line option. + */ const char *commandline_options_description = "-h, -help : gets this help.\n" "-O[v], -describe-all-parameters : describes all the parameters.\n" diff --git a/src/main/ProcessCommandLine.c b/src/main/ProcessCommandLine.c index 97b7a40c..3c19b6c6 100644 --- a/src/main/ProcessCommandLine.c +++ b/src/main/ProcessCommandLine.c @@ -93,6 +93,19 @@ static char **argv = NULL; @@*/ int CCTKi_ProcessCommandLine(int *inargc, char ***inargv, tFleshConfig *ConfigData) { + /* + * If you add a new command-line option, you must update (at least) + * the following different places in the code: + * - the definition of long_options[] in this function + * - the 3rd argument in the call to getopt_long_only() in this function + * - the switch (c) statement in this function + * - the #define of CACTUS_COMMANDLINE_OPTIONS near the top of + * src/main/CommandLine.c + * - the help message printed by CCTKi_CommandLineHelp() + * (also in src/main/CommandLine.c ) + * You should also update the description of command-line options in the + * Cactus Users' Guide, in doc/UsersGuide/RunningCactus.tex . + */ int option_index = 0; int c; |