diff options
author | sbrandt <sbrandt@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2012-07-24 21:55:30 +0000 |
---|---|---|
committer | sbrandt <sbrandt@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2012-07-24 21:55:30 +0000 |
commit | cf13be94c26c1f6085b82e9287772927f021ba08 (patch) | |
tree | d040d15c017e4e403eff58cc459b2ff5b9ada3d7 /src/main | |
parent | f7bdf7268a003af3ac0b3ee148d4c196a16827f6 (diff) |
Committing change for ticket #176
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4851 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/ProcessCommandLine.c | 11 | ||||
-rw-r--r-- | src/main/WarnLevel.c | 20 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/main/ProcessCommandLine.c b/src/main/ProcessCommandLine.c index d47ad721..ae95a071 100644 --- a/src/main/ProcessCommandLine.c +++ b/src/main/ProcessCommandLine.c @@ -41,6 +41,8 @@ void CCTK_FCALL CCTK_FNAME(CCTK_ParameterFilename) ********************* Local Data ***************************** ********************************************************************/ +static int exit_after_param_check = 0; + static char *parameter_file_name=NULL; static int argc = 0; @@ -129,6 +131,7 @@ int CCTKi_ProcessCommandLine(int *inargc, char ***inargv, tFleshConfig *ConfigDa list_thorns_option = 'T', test_thorns_compiled_option = 't', version_option = 'v', + exit_after_param_check_option = 'p', ignore_next_option = 'i' }; /* the longopts argument passed into getopt_long_only() */ @@ -148,6 +151,7 @@ int CCTKi_ProcessCommandLine(int *inargc, char ***inargv, tFleshConfig *ConfigDa {"print-schedule", no_argument, NULL, print_schedule_option}, {"list-thorns", no_argument, NULL, list_thorns_option}, {"test-thorn-compiled", required_argument, NULL, test_thorns_compiled_option}, + {"exit-after-param-check", no_argument, NULL, exit_after_param_check_option}, {"version", no_argument, NULL, version_option}, {"ignore-next", no_argument, NULL, ignore_next_option}, {0, 0, 0, 0} @@ -203,6 +207,8 @@ int CCTKi_ProcessCommandLine(int *inargc, char ***inargv, tFleshConfig *ConfigDa CCTKi_CommandLineVersion(); break; case ignore_next_option: ignore = 1; break; + case exit_after_param_check_option: + exit_after_param_check = 1; break; case help_option: case '?': CCTKi_CommandLineHelp(); break; @@ -334,6 +340,11 @@ void CCTK_FCALL CCTK_FNAME(CCTK_ParameterFilename) *retval = CCTK_ParameterFilename(*len,name); } +int CCTK_ExitAfterParamCheck() +{ + return exit_after_param_check; +} + /******************************************************************** ********************* Local Routines ************************* ********************************************************************/ diff --git a/src/main/WarnLevel.c b/src/main/WarnLevel.c index c5557ffe..2519910e 100644 --- a/src/main/WarnLevel.c +++ b/src/main/WarnLevel.c @@ -1137,6 +1137,25 @@ int CCTKi_SetErrorLevel (int level) } +int CCTK_ExitAfterParamCheck(); + /*@@ + @routine ExitIfParamCheckOnly + @date Mon May 16 2012 + @author Steven R. Brandt + @desc + Responsible for exiting after paramcheck + @enddesc + +@@*/ +void CCTK_ExitIfParamCheckOnly() +{ + if(CCTK_ExitAfterParamCheck()) { + printf("Exit after param check requested using the --exit-after-param-check option.\n"); + CCTK_Exit(NULL, 0); + } +} + + /*@@ @routine CCTKi_FinaliseParamWarn @date June 1999 @@ -1191,6 +1210,7 @@ void CCTKi_FinaliseParamWarn (void) } } } + CCTK_ExitIfParamCheckOnly(); } |