MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / showHelp

Function showHelp

CLI/CLI.cpp:319–340  ·  view source on GitHub ↗

Give a list of available commands or describe a specific command. */

Source from the content-addressed store, hash-verified

317
318/** Give a list of available commands or describe a specific command. */
319static CLIStatus showHelp(int argc, char** argv, ostream& os)
320{
321 if (argc==2) {
322 os << argv[1] << " " << gParser.help(argv[1]) << endl;
323 return SUCCESS;
324 }
325 if (argc!=1) return BAD_NUM_ARGS;
326 ParseTable::const_iterator cp = gParser.begin();
327 os << endl << "Type \"help\" followed by the command name for help on that command." << endl << endl;
328 int c=0;
329 const int cols = 3;
330 while (cp != gParser.end()) {
331 const string& wd = cp->first;
332 os << wd << '\t';
333 if (wd.size()<8) os << '\t';
334 ++cp;
335 c++;
336 if (c%cols==0) os << endl;
337 }
338 if (c%cols!=0) os << endl;
339 return SUCCESS;
340}
341
342
343

Callers

nothing calls this directly

Calls 4

helpMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected