MCPcopy Create free account
hub / github.com/covscript/covscript / main

Function main

sources/debugger.cpp:748–788  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

746}
747
748int main(int args_size, char *args[])
749{
750 std::ios::sync_with_stdio(false);
751 int errorcode = 0;
752 try {
753 covscript_main(args_size, args);
754 }
755 catch (const std::exception &e) {
756 if (!log_path.empty()) {
757 std::ofstream out(::log_path);
758 if (out) {
759 out << e.what();
760 out.flush();
761 }
762 else
763 std::cerr << "Write log failed." << std::endl;
764 }
765 std::cerr << e.what() << std::endl;
766 errorcode = -1;
767 }
768 catch (...) {
769 if (!log_path.empty()) {
770 std::ofstream out(::log_path);
771 if (out) {
772 out << "Uncaught exception: Unknown exception";
773 out.flush();
774 }
775 else
776 std::cerr << "Write log failed." << std::endl;
777 }
778 std::cerr << "Uncaught exception: Unknown exception" << std::endl;
779 errorcode = -1;
780 }
781 if (wait_before_exit) {
782 std::cerr << "\nProcess finished with exit code " << errorcode << std::endl;
783 std::cerr << "\nPress any key to exit..." << std::endl;
784 while (!cs_impl::conio::kbhit());
785 cs_impl::conio::getch();
786 }
787 return errorcode;
788}

Callers

nothing calls this directly

Calls 5

covscript_mainFunction · 0.70
kbhitFunction · 0.50
getchFunction · 0.50
emptyMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected