60 virtual void usage(TCLAP::CmdLineInterface& _cmd)
63 std::cout << std::endl <<
"USAGE: " << std::endl << std::endl;
64 _shortUsage(_cmd, std::cout);
65 std::cout << std::endl
67 <<
"Where: " << std::endl
70 std::string
const message = _cmd.getMessage();
71 std::list<TCLAP::ArgGroup*> argSets = _cmd.getArgGroups();
73 std::list<TCLAP::Arg*> unlabelled;
74 for (
auto& argSet : argSets)
76 TCLAP::ArgGroup& argGroup = *argSet;
78 int const visible = CountVisibleArgs(argGroup);
79 bool const exclusive = visible > 1 && argGroup.isExclusive();
80 bool const forceRequired = visible == 1 && argGroup.isRequired();
84 argGroup.isRequired() ?
"One of:" :
"Either of:", 75,
88 for (
auto& it : argGroup)
90 TCLAP::Arg& arg = *it;
92 if (!arg.visibleInHelp())
99 unlabelled.push_back(&arg);
104 std::string
const shortID = arg.shortID();
106 bool const required = arg.isRequired() || forceRequired;
107 std::stringstream ss;
108 if (std::regex_search(shortID, match, std::regex(
"<([^>]+)>")))
110 std::string
const identifier = match[1];
122 ss << arg.getDescription(required);
126 spacePrint(std::cout, arg.longID(), 75, 6, 3);
127 spacePrint(std::cout, ss.str(), 75, 8, 0);
131 spacePrint(std::cout, arg.longID(), 75, 3, 3);
132 spacePrint(std::cout, ss.str(), 75, 5, 0);
138 for (TCLAP::ArgListIterator it = unlabelled.begin();
139 it != unlabelled.end();
142 const TCLAP::Arg& arg = **it;
143 spacePrint(std::cout, arg.longID(), 75, 3, 3);
144 spacePrint(std::cout, arg.getDescription(), 75, 5, 0);
148 if (!message.empty())
150 spacePrint(std::cout, message, 75, 3, 0);