fix sim help message and handle bad command line args #840

This commit is contained in:
Scott Fennell 2019-07-10 13:53:03 -05:00
parent 5f38ca4c37
commit 1d17aa579a
2 changed files with 9 additions and 0 deletions

View File

@ -172,6 +172,14 @@ int Trick::CommandLineArguments::process_sim_args(int nargs , char **args) {
}
}
if (access(input_file.c_str(), F_OK) != 0) {
input_file = "";
if(strcmp(argv[1], "trick_version") && strcmp(argv[1], "sie") && strcmp(argv[1], "-help") && strcmp(argv[1], "--help") &&
strcmp(argv[1], "-h") && strcmp(argv[1], "help")) {
std::cerr << "\nWARNING: No valid input file detected in command line arguments" << std::endl;
}
}
found = run_dir.find_last_of("/") ;
if ( found != std::string::npos ) {
run_dir.erase(found) ;

View File

@ -64,6 +64,7 @@ int Trick::Executive::process_sim_args() {
} else if (!strcmp(argv[1], "-help") || !strcmp(argv[1], "--help") ||
!strcmp(argv[1], "-h") || !strcmp(argv[1], "help") ) {
/* Try and help the user */
printf("%s", buf);
exit(0);
} else if (!strcmp(argv[1], "sie")) {
/* do not create init_log.csv if we are generating sie */