MCPcopy Create free account
hub / github.com/apache/trafficserver / output_command

Method output_command

src/tscore/ArgParser.cc:320–340  ·  view source on GitHub ↗

method used by help_message()

Source from the content-addressed store, hash-verified

318
319// method used by help_message()
320void
321ArgParser::Command::output_command(std::ostream &out, std::string const &prefix) const
322{
323 if (_name != parser_program_name) {
324 // a nicely formatted way to output command usage
325 std::string msg = prefix + _name;
326 // nicely formatted output
327 if (!_description.empty()) {
328 if (INDENT_ONE - static_cast<int>(msg.size()) < 0) {
329 // if the command msg is too long
330 std::cout << msg << "\n" << std::string(INDENT_ONE, ' ') << _description << std::endl;
331 } else {
332 std::cout << msg << std::string(INDENT_ONE - msg.size(), ' ') << _description << std::endl;
333 }
334 }
335 }
336 // recursive call
337 for (const auto &it : _subcommand_list) {
338 it.second.output_command(out, " " + prefix);
339 }
340}
341
342// a nicely formatted way to output option message for help.
343void

Callers

nothing calls this directly

Calls 3

stringClass · 0.85
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected