MCPcopy Create free account
hub / github.com/SeisSol/SeisSol / helpMessage

Method helpMessage

preprocessing/meshing/cube_c/src/utils/args.h:324–405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322 }
323
324 void helpMessage(const char* prog, std::ostream &out = std::cout)
325 {
326 // First line with all short options
327 out << "Usage: " << prog;
328 for (size_t i = 0; i < m_options.size()-1; i++) {
329 out << ' ';
330
331 if (!m_optionInfo[i].required)
332 out << '[';
333
334 if (m_options[i].val != 0)
335 out << '-' << static_cast<char>(m_options[i].val);
336 else
337 out << "--" << m_options[i].name;
338
339 argumentInfo(i, out);
340
341 if (!m_optionInfo[i].required)
342 out << ']';
343 }
344 for (size_t i = 0; i < m_additionalOptionInfo.size(); i++) {
345 out << ' ';
346
347 if (!m_additionalOptionInfo[i].required)
348 out << '[';
349
350 out << '<' << m_additionalOptionInfo[i].name << '>';
351
352 if (!m_additionalOptionInfo[i].required)
353 out << ']';
354
355 }
356 out << std::endl;
357
358 // General program description
359 if (!m_description.empty())
360 out << std::endl << m_description << std::endl;
361
362 // Arguments
363 out << std::endl << "arguments:" << std::endl;
364 for (size_t i = 0; i < m_additionalOptionInfo.size(); i++) {
365 out << " <" << m_additionalOptionInfo[i].name << '>';
366
367 // Number of characters used for the option
368 size_t length = 4 + m_additionalOptionInfo[i].name.size();
369
370 if (length >= 30) {
371 out << std::endl;
372 out << std::setw(30) << ' ';
373 } else
374 out << std::setw(30-length) << ' ';
375
376 out << m_additionalOptionInfo[i].description << std::endl;
377 }
378
379 // Optional arguments
380 out << std::endl << "optional arguments:" << std::endl;
381 for (size_t i = 0; i < m_options.size()-1; i++) {

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected