detailed stracktrace only when option -d, second implemented in c++

This commit is contained in:
2021-10-11 12:04:49 +02:00
parent b68987fdd7
commit ecbc3af789
6 changed files with 38 additions and 47 deletions

5
ml.cpp
View File

@@ -2162,6 +2162,9 @@ int main(int argc, char *argv[]) {
// performance monitor on
if (cmdOptionExists(argv, argv + argc, "-p"))
MlPerfMon::instance().turnOn();
// better stacktrace
if (cmdOptionExists(argv, argv + argc, "-d"))
MlPerfMon::instance().debugOn();
// skip loading std lib
if (!cmdOptionExists(argv, argv + argc, "-b")) {
load_std_lib(env);
@@ -2169,7 +2172,7 @@ int main(int argc, char *argv[]) {
// help
if (cmdOptionExists(argv, argv + argc, "-h")) {
std::cout
<< "Usage:\n\t-h print this help\n\t-b skip stdlib loading\n\t-c code - runs code passed on command line\n\t-f source_file - executes code in file\n\t-i runs repl\n\t-run used for shebang\n\t-p prints profile info at the end\n\t-v prints version string\n\n";
<< "Usage:\n\t-h print this help\n\t-b skip stdlib loading\n\t-c code - runs code passed on command line\n\t-f source_file - executes code in file\n\t-i runs repl\n\t-run used for shebang\n\t-p prints profile info at the end\n\t-d better stacktrace when exception\n\t-v prints version string\n\n";
return 0;
}
// version