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 (std::list<TCLAP::ArgGroup*>::iterator sit = argSets.begin();
78 TCLAP::ArgGroup& argGroup = **sit;
80 int const visible = CountVisibleArgs(argGroup);
81 bool const exclusive = visible > 1 && argGroup.isExclusive();
82 bool const forceRequired = visible == 1 && argGroup.isRequired();
86 argGroup.isRequired() ?
"One of:" :
"Either of:", 75,
90 for (TCLAP::ArgGroup::iterator it = argGroup.begin();
94 TCLAP::Arg& arg = **it;
96 if (!arg.visibleInHelp())
103 unlabelled.push_back(&arg);
108 std::string
const shortID = arg.shortID();
110 bool const required = arg.isRequired() || forceRequired;
111 std::stringstream ss;
112 if (std::regex_search(shortID, match, std::regex(
"<([^>]+)>")))
114 std::string
const identifier = match[1];
126 ss << arg.getDescription(required);
130 spacePrint(std::cout, arg.longID(), 75, 6, 3);
131 spacePrint(std::cout, ss.str(), 75, 8, 0);
135 spacePrint(std::cout, arg.longID(), 75, 3, 3);
136 spacePrint(std::cout, ss.str(), 75, 5, 0);
142 for (TCLAP::ArgListIterator it = unlabelled.begin();
143 it != unlabelled.end();
146 const TCLAP::Arg& arg = **it;
147 spacePrint(std::cout, arg.longID(), 75, 3, 3);
148 spacePrint(std::cout, arg.getDescription(), 75, 5, 0);
152 if (!message.empty())
154 spacePrint(std::cout, message, 75, 3, 0);