19int main(
int argc,
char** argv) {
20 argparse::ArgumentParser program(
"mps");
22 program.add_argument(
"-s",
"--setting")
24 .help(
"path to setting file")
25 .action([](
const std::string& value) {
26 if (!fs::exists(value)) {
27 cout <<
"ERROR: The setting file " << value <<
" does not exist" << endl;
28 cerr <<
"ERROR: The setting file " << value <<
" does not exist" << endl;
31 cout <<
"Setting file: " << value << endl;
35 program.add_argument(
"-o",
"--output")
37 .help(
"path to output directory")
38 .action([](
const std::string& value) {
39 if (!fs::exists(value)) {
40 cout <<
"ERROR: The output directory " << value <<
" does not exist" << endl;
41 cerr <<
"ERROR: The output directory " << value <<
" does not exist" << endl;
44 cout <<
"Output directory: " << value << endl;
45 fs::create_directories(value);
53 program.parse_args(argc, argv);
54 }
catch (
const std::exception& err) {
55 cout << err.what() << endl;
56 cerr << err.what() << endl;
62 auto settingPath = fs::path(program.get<std::string>(
"--setting"));
63 auto outputDirectory = fs::path(program.get<std::string>(
"--output"));
64 Simulation simulation(settingPath, outputDirectory);
int main(int argc, char **argv)
entry point of the program