| 264 | static std::set<FlatCOption, decltype(cmp)> language_options(cmp); |
| 265 | |
| 266 | static void AppendTextWrappedString(std::stringstream &ss, std::string &text, |
| 267 | size_t max_col, size_t start_col) { |
| 268 | size_t max_line_length = max_col - start_col; |
| 269 | |
| 270 | if (text.length() > max_line_length) { |
| 271 | size_t ideal_break_location = text.rfind(' ', max_line_length); |
| 272 | size_t length = std::min(max_line_length, ideal_break_location); |
| 273 | ss << text.substr(0, length) << "\n"; |
| 274 | ss << std::string(start_col, ' '); |
| 275 | std::string rest_of_description = text.substr( |
| 276 | ((ideal_break_location < max_line_length || text.at(length) == ' ') |
| 277 | ? length + 1 |
| 278 | : length)); |
| 279 | AppendTextWrappedString(ss, rest_of_description, max_col, start_col); |
| 280 | } else { |
| 281 | ss << text; |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | static void AppendOption(std::stringstream &ss, const FlatCOption &option, |
| 286 | size_t max_col, size_t min_col_for_description) { |