23{
24
25 TCLAP::CmdLine cmd(
26 "OpenGeoSys-6 software."
27 "\n"
28 "Copyright (c) 2012-2024, OpenGeoSys Community "
29 "(https://www.opengeosys.org) "
30 "\n"
31 "Distributed under a Modified BSD License. "
32 "See accompanying file LICENSE.txt or "
33 "https://www.opengeosys.org/project/license"
34 "\n"
35 "version: " +
37 "\n"
38 "CMake arguments: " +
39 CMakeInfoLib::CMakeInfo::cmake_args,
40 ' ',
42 "CMake arguments: " + CMakeInfoLib::CMakeInfo::cmake_args);
43
44 cmd.setExceptionHandling(exit_on_exception);
45
46 TCLAP::ValueArg<std::string> log_level_arg(
47 "l", "log-level",
48 "the verbosity of logging messages: none, error, warn, info, "
49 "debug, "
50 "all",
51 false,
52#ifdef NDEBUG
53 "info",
54#else
55 "all",
56#endif
57 "LOG_LEVEL");
58
59#ifndef _WIN32
60
61 TCLAP::SwitchArg enable_fpe_arg("", "enable-fpe",
62 "enables floating point exceptions");
63#endif
64 TCLAP::SwitchArg unbuffered_cout_arg("", "unbuffered-std-out",
65 "use unbuffered standard output");
66
67 TCLAP::ValueArg<std::string> reference_path_arg(
68 "r", "reference",
69 "Run output result comparison after successful simulation "
70 "comparing to all files in the given path. This requires test "
71 "definitions to be present in the project file.",
72 false, "", "PATH");
73
74 TCLAP::UnlabeledValueArg<std::string> project_arg(
75 "project-file",
76 "Path to the ogs6 project file.",
77 true,
78 "",
79 "PROJECT_FILE");
80
81 TCLAP::MultiArg<std::string> xml_patch_files_arg(
82 "p", "xml-patch",
83 "the xml patch file(s) which is (are) applied (in the given order) "
84 "to the PROJECT_FILE",
85 false, "");
86
87 TCLAP::ValueArg<std::string> outdir_arg("o", "output-directory",
88 "the output directory to write to",
89 false, "", "PATH");
90
91 TCLAP::ValueArg<std::string> mesh_dir_arg(
92 "m", "mesh-input-directory",
93 "the directory where the meshes are read from", false, "", "PATH");
94
95 TCLAP::ValueArg<std::string> script_dir_arg(
96 "s", "script-input-directory",
97 "the directory where script files (e.g. Python BCs) are read from",
98 false, "", "PATH");
99
100 TCLAP::SwitchArg write_prj_arg("",
101 "write-prj",
102 "Writes processed project file to output "
103 "path / [prj_base_name]_processed.prj.");
104
105 TCLAP::SwitchArg nonfatal_arg("",
106 "config-warnings-nonfatal",
107 "warnings from parsing the configuration "
108 "file will not trigger program abortion");
109 cmd.add(reference_path_arg);
110 cmd.add(project_arg);
111 cmd.add(xml_patch_files_arg);
112 cmd.add(outdir_arg);
113 cmd.add(mesh_dir_arg);
114 cmd.add(script_dir_arg);
115 cmd.add(write_prj_arg);
116 cmd.add(log_level_arg);
117 cmd.add(nonfatal_arg);
118 cmd.add(unbuffered_cout_arg);
119#ifndef _WIN32
120
121 cmd.add(enable_fpe_arg);
122#endif
123
124 cmd.parse(argc, argv);
125
129 cli_args.
project = project_arg.getValue();
130
132
134 cli_args.
outdir = outdir_arg.getValue();
135 cli_args.
mesh_dir = mesh_dir_arg.getValue().empty()
138 cli_args.
script_dir = script_dir_arg.getValue().empty()
141 cli_args.
nonfatal = nonfatal_arg.getValue();
142 cli_args.
log_level = log_level_arg.getValue();
143 cli_args.
write_prj = write_prj_arg.getValue();
144
145
146 if (unbuffered_cout_arg.isSet())
147 {
148 std::cout.setf(std::ios::unitbuf);
149 }
150#ifndef _WIN32
152#endif
153
154 return cli_args;
155}
std::string const & getProjectDirectory()
Returns the directory where the prj file resides.
std::string extractPath(std::string const &pathname)
void setProjectDirectory(std::string const &dir)
Sets the project directory.
GITINFOLIB_EXPORT const std::string ogs_version
bool reference_path_is_set
std::string reference_path
std::vector< std::string > xml_patch_file_names