| 216 | } |
| 217 | |
| 218 | inline void CommandLineParser::print_help(const std::string &program_name) const |
| 219 | { |
| 220 | std::cout << "usage: " << program_name << " \n"; |
| 221 | |
| 222 | for (const auto &option : _options) |
| 223 | { |
| 224 | std::cout << option.second->help() << "\n"; |
| 225 | } |
| 226 | |
| 227 | for (const auto &option : _positional_options) |
| 228 | { |
| 229 | std::string help_to_print; |
| 230 | |
| 231 | // Extract help sub-string |
| 232 | const std::string help_str = option->help(); |
| 233 | const size_t help_pos = help_str.find(" - "); |
| 234 | if (help_pos != std::string::npos) |
| 235 | { |
| 236 | help_to_print = help_str.substr(help_pos); |
| 237 | } |
| 238 | |
| 239 | std::cout << option->name() << help_to_print << "\n"; |
| 240 | } |
| 241 | } |
| 242 | } // namespace utils |
| 243 | } // namespace arm_compute |
| 244 | #endif /* ARM_COMPUTE_UTILS_COMMANDLINEPARSER */ |
no test coverage detected