MCPcopy Create free account
hub / github.com/OpenPathGuidingLibrary/openpgl / parseCommandLine

Function parseCommandLine

tools/openpgl_debug/openpgl_debug.cpp:224–439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222};
223
224bool parseCommandLine(std::list<std::string> &args, DebugParams &debugParams)
225{
226 bool collectSamples = false;
227 for (auto it = args.begin(); it != args.end();)
228 {
229 const std::string arg = *it;
230
231 if (arg == "-help")
232 {
233 collectSamples = false;
234 debugParams.type = DebugType::HELP;
235 }
236 else if (arg == "-type")
237 {
238 collectSamples = false;
239 ++it;
240 if (it != args.end())
241 {
242 const std::string str_type = *it;
243 if (str_type == "fitField")
244 {
245 debugParams.type = DebugType::FIT_FIELD;
246 }
247 else if (str_type == "updateField")
248 {
249 debugParams.type = DebugType::UPDATE_FIELD;
250 }
251 else if (str_type == "validateField")
252 {
253 debugParams.type = DebugType::VALIDATE_FIELD;
254 }
255 else if (str_type == "validateSamples")
256 {
257 debugParams.type = DebugType::VALIDATE_SAMPLES;
258 }
259 else if (str_type == "exportSamplesToOBJ")
260 {
261 debugParams.type = DebugType::EXPORT_SAMPLES;
262 }
263 else if (str_type == "compareSamples")
264 {
265 debugParams.type = DebugType::COMPARE_SAMPLES;
266 }
267 else if (str_type == "compareFields")
268 {
269 debugParams.type = DebugType::COMPARE_FIELDS;
270 }
271 else if (str_type == "updateCompareFields")
272 {
273 debugParams.type = DebugType::UPDATE_COMPARE_FIELDS;
274 }
275 else if (str_type == "mergeSamples")
276 {
277 debugParams.type = DebugType::MERGE_SAMPLES;
278 }
279 else
280 {
281 std::cout << "ERROR: Unknown type: " << str_type << std::endl;

Callers 1

mainFunction · 0.70

Calls 3

beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected