MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / usage

Method usage

src/apputils/argparse.cpp:478–509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

476
477
478void
479ArgParse::usage () const
480{
481 const size_t longline = 40;
482 std::cout << m_intro << '\n';
483 size_t maxlen = 0;
484
485 for (unsigned int i=0; i<m_option.size(); ++i) {
486 ArgOption *opt = m_option[i];
487 size_t fmtlen = opt->fmt().length();
488 // Option lists > 40 chars will be split into multiple lines
489 if (fmtlen < longline)
490 maxlen = std::max (maxlen, fmtlen);
491 }
492
493 for (unsigned int i=0; i<m_option.size(); ++i) {
494 ArgOption *opt = m_option[i];
495 if (opt->description().length()) {
496 size_t fmtlen = opt->fmt().length();
497 if (opt->fmt() == "<SEPARATOR>")
498 std::cout << opt->description() << '\n';
499 else if (fmtlen < longline)
500 std::cout << " " << opt->fmt()
501 << std::string (maxlen + 2 - fmtlen, ' ')
502 << opt->description() << '\n';
503 else
504 std::cout << " " << opt->fmt() << "\n "
505 << std::string (maxlen + 2, ' ')
506 << opt->description() << '\n';
507 }
508 }
509}
510
511
512

Callers 13

mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
UnitTestMainFunction · 0.80

Calls 2

descriptionMethod · 0.80
sizeMethod · 0.45

Tested by 3

mainFunction · 0.64
UnitTestMainFunction · 0.64
mainFunction · 0.64