#837 default input file to first argument if RUN_ is not present

This commit is contained in:
Scott Fennell 2019-07-08 09:28:53 -05:00
parent ca5ddb429e
commit c2d2fee474

View File

@ -158,14 +158,19 @@ int Trick::CommandLineArguments::process_sim_args(int nargs , char **args) {
if ( argc > 1 ) {
/* First occurnance of "RUN_*" is the input file name: '<Run_dir>/<file_name>' */
for(int ii = 1; ii < argc; ii++) {
if(std::string(argv[ii]).find("RUN_") != std::string::npos) {
input_file = argv[ii];
run_dir = argv[ii];
break;
/* First occurnance of "RUN_*" is the input file name: '<Run_dir>/<file_name>'.
If not found, defaults to first argument */
input_file = argv[1];
run_dir = argv[1];
for(int ii = 1; ii < argc; ii++) {
if(std::string(argv[ii]).find("RUN_") != std::string::npos) {
input_file = argv[ii];
run_dir = argv[ii];
break;
}
}
}
found = run_dir.find_last_of("/") ;
if ( found != std::string::npos ) {