summaryrefslogtreecommitdiff
path: root/src/main/ProcessCommandLine.c
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-12-12 23:51:59 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-12-12 23:51:59 +0000
commiteed931adec041e08f3d6ca177e06146bf3560f57 (patch)
treefab08c7cf047c256cdc7e9ffb981caa0da7b21a4 /src/main/ProcessCommandLine.c
parent9f2839e7c5af4047aa7331c17b90c620d09f1816 (diff)
Added -i as an option. This says to ignore the next argument. Note that
you can't ignore non-arguments, so still need the parameter file name to be before any other non-arguments. E.g. on the NCSA NT cluster you should do ./cactus_foo foobar.par -i -np 20 -i -key hjwhghfgg to run in parallel. This is basically to work around buggy MPI implementations which don't remove their arguments from the command line. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@1941 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/ProcessCommandLine.c')
-rw-r--r--src/main/ProcessCommandLine.c47
1 files changed, 30 insertions, 17 deletions
diff --git a/src/main/ProcessCommandLine.c b/src/main/ProcessCommandLine.c
index 9ea4b468..61e22863 100644
--- a/src/main/ProcessCommandLine.c
+++ b/src/main/ProcessCommandLine.c
@@ -90,12 +90,15 @@ int CCTKi_ProcessCommandLine(int *inargc, char ***inargv, tFleshConfig *ConfigDa
int option_index = 0;
int c;
+ int ignore;
/* Store the command line */
argc = *inargc;
argv = *inargv;
+ ignore = 0;
+
/* Process the command line - needs some work !*/
if(argc>1)
@@ -113,31 +116,41 @@ int CCTKi_ProcessCommandLine(int *inargc, char ***inargv, tFleshConfig *ConfigDa
{"redirect-stdout", no_argument, NULL, 'r'},
{"list-thorns", no_argument, NULL, 'T'},
{"test-thorn-compiled", required_argument, NULL, 't'},
- {"version", no_argument, NULL, 'v'},
+ {"version", no_argument, NULL, 'v'},
+ {"ignore-next", no_argument, NULL, 'i'},
{0, 0, 0, 0}
};
- c = getopt_long_only (argc, argv, "hO::o:x::W:E:rTt:v",
+ c = getopt_long_only (argc, argv, "hO::o:x::W:E:rTt:vi",
long_options, &option_index);
if (c == -1)
break;
- switch (c)
+ if(!ignore)
+ {
+ switch (c)
+ {
+ case 't': CCTKi_CommandLineTestThornCompiled(optarg); break;
+ case 'O': CCTKi_CommandLineDescribeAllParameters(optarg); break;
+ case 'o': CCTKi_CommandLineDescribeParameter(optarg); break;
+ case 'x': CCTKi_CommandLineTestParameters(optarg); break;
+ case 'W': CCTKi_CommandLineWarningLevel(optarg); break;
+ case 'E': CCTKi_CommandLineErrorLevel(optarg); break;
+ case 'r': CCTKi_CommandLineRedirectStdout(); break;
+ case 'T': CCTKi_CommandLineListThorns(); break;
+ case 'v': CCTKi_CommandLineVersion(); break;
+ case 'i': ignore = 1; break;
+ case 'h':
+ case '?':
+ CCTKi_CommandLineHelp(); break;
+ default:
+ printf ("?? getopt returned character code 0%o ??\n", c);
+ }
+ }
+ else
{
- case 't': CCTKi_CommandLineTestThornCompiled(optarg); break;
- case 'O': CCTKi_CommandLineDescribeAllParameters(optarg); break;
- case 'o': CCTKi_CommandLineDescribeParameter(optarg); break;
- case 'x': CCTKi_CommandLineTestParameters(optarg); break;
- case 'W': CCTKi_CommandLineWarningLevel(optarg); break;
- case 'E': CCTKi_CommandLineErrorLevel(optarg); break;
- case 'r': CCTKi_CommandLineRedirectStdout(); break;
- case 'T': CCTKi_CommandLineListThorns(); break;
- case 'v': CCTKi_CommandLineVersion(); break;
- case 'h':
- case '?':
- CCTKi_CommandLineHelp(); break;
- default:
- printf ("?? getopt returned character code 0%o ??\n", c);
+ printf("Ignoring option\n");
+ ignore = 0;
}
}