MCPcopy Create free account
hub / github.com/docopt/docopt.cpp / formal_usage

Function formal_usage

docopt.cpp:471–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

469
470
471static std::string formal_usage(std::string const& section) {
472 std::string ret = "(";
473
474 auto i = section.find(':')+1; // skip past "usage:"
475 auto parts = split(section, i);
476 for(size_t ii = 1; ii < parts.size(); ++ii) {
477 if (parts[ii] == parts[0]) {
478 ret += " ) | (";
479 } else {
480 ret.push_back(' ');
481 ret += parts[ii];
482 }
483 }
484
485 ret += " )";
486 return ret;
487}
488
489static PatternList parse_argv(Tokens tokens, std::vector<Option>& options, bool options_first)
490{

Callers 1

create_pattern_treeFunction · 0.85

Calls 1

splitFunction · 0.85

Tested by

no test coverage detected