Write a verbose description of arguments to an output stream. Each argument is on its own line. The argument's description follows on subsequent lines. \param out Stream to which output should be written. \param nameIndent Number of characters to indent argument lines. \param descripIndent Number of characters to indent description lines. \param totalWidth
| 1400 | |
| 1401 | */ |
| 1402 | void dump2(std::ostream& out, size_t nameIndent, size_t descripIndent, |
| 1403 | size_t totalWidth) const |
| 1404 | { |
| 1405 | size_t width = totalWidth - descripIndent; |
| 1406 | for (auto ai = m_args.begin(); ai != m_args.end(); ++ai) |
| 1407 | { |
| 1408 | Arg *a = ai->get(); |
| 1409 | out << std::string(nameIndent, ' ') << a->longname(); |
| 1410 | if (a->defaultProvided()) |
| 1411 | out << " [" << a->defaultVal() << "]"; |
| 1412 | out << std::endl; |
| 1413 | std::vector<std::string> descrip = |
| 1414 | Utils::wordWrap(a->description(), width); |
| 1415 | if (descrip.empty()) |
| 1416 | descrip.push_back("<no description available>"); |
| 1417 | for (std::string& s : descrip) |
| 1418 | out << std::string(descripIndent, ' ') << s << std::endl; |
| 1419 | out << std::endl; |
| 1420 | } |
| 1421 | } |
| 1422 | |
| 1423 | /** |
| 1424 | Write a JSON array of arguments to an output stream. |
no test coverage detected