| 31 | } |
| 32 | |
| 33 | void Plugin::log_help(size_t width) const |
| 34 | { |
| 35 | LOGI(""); |
| 36 | LOGI("\t{}", name); |
| 37 | LOGI("\t\t{}", description); |
| 38 | LOGI(""); |
| 39 | |
| 40 | if (!commands.empty()) |
| 41 | { |
| 42 | LOGI("\t\tSubcommands:"); |
| 43 | for (auto const &command : commands) |
| 44 | { |
| 45 | std::ostringstream oss; |
| 46 | oss.setf(std::ios::left); |
| 47 | oss.width(width + 2); |
| 48 | oss << command.first; |
| 49 | LOGI("\t\t\t{}{}", oss.str().c_str(), command.second); |
| 50 | } |
| 51 | LOGI(""); |
| 52 | } |
| 53 | |
| 54 | if (!options.empty()) |
| 55 | { |
| 56 | LOGI("\t\tOptions:"); |
| 57 | for (auto const &option : options) |
| 58 | { |
| 59 | std::ostringstream oss; |
| 60 | oss.setf(std::ios::left); |
| 61 | oss.width(width); |
| 62 | oss << option.first; |
| 63 | LOGI("\t\t\t--{}{}", oss.str().c_str(), option.second); |
| 64 | } |
| 65 | LOGI(""); |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | } // namespace vkb |