MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / usage

Method usage

src/commandline.cpp:334–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332}
333
334std::string CommandLine::usage(const Command* c) const
335{
336 std::ostringstream oss;
337
338 oss << "\n"
339 << "Usage:\n";
340
341 if (c) {
342 oss << " ModOrganizer.exe [global-options] " << c->usageLine() << "\n\n";
343
344 const std::string more = c->moreInfo();
345 if (!more.empty()) {
346 oss << more << "\n\n";
347 }
348
349 oss << "Command options:\n" << c->visibleOptions() << "\n";
350 } else {
351 oss << " ModOrganizer.exe [options] [[command] [command-options]]\n"
352 << "\n"
353 << "Commands:\n";
354
355 // name and description for all commands
356 std::vector<std::pair<std::string, std::string>> v;
357 for (auto&& c : m_commands) {
358 // don't show legacy commands
359 if (c->legacy()) {
360 continue;
361 }
362
363 v.push_back({c->name(), c->description()});
364 }
365
366 oss << table(v, 2, 4) << "\n"
367 << "\n";
368 }
369
370 oss << "Global options:\n" << m_visibleOptions << "\n";
371
372 // show the more text unless this is usage for a specific command
373 if (!c) {
374 oss << "\n" << more() << "\n";
375 }
376
377 return oss.str();
378}
379
380bool CommandLine::pick() const
381{

Callers

nothing calls this directly

Calls 8

tableFunction · 0.85
usageLineMethod · 0.80
moreInfoMethod · 0.80
visibleOptionsMethod · 0.80
legacyMethod · 0.80
descriptionMethod · 0.80
emptyMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected