Return a string suitable for use in a "usage" line for display to users as help. */
| 1312 | users as help. |
| 1313 | */ |
| 1314 | std::string commandLine() const |
| 1315 | { |
| 1316 | std::string s; |
| 1317 | |
| 1318 | for (auto ai = m_args.begin(); ai != m_args.end(); ++ai) |
| 1319 | { |
| 1320 | Arg *a = ai->get(); |
| 1321 | |
| 1322 | if (a->hidden()) |
| 1323 | continue; |
| 1324 | std::string o = a->commandLine(); |
| 1325 | if (o.size()) |
| 1326 | s += o + " "; |
| 1327 | } |
| 1328 | if (s.size()) |
| 1329 | s = s.substr(0, s.size() - 1); |
| 1330 | return s; |
| 1331 | } |
| 1332 | |
| 1333 | /** |
| 1334 | Write a formatted description of arguments to an output stream. |