Wraps a given paragraph to fit within the same number of characters as the standard helper message from Boost Program Options.
150 if (text.size() == 0)
return text;
152 vector<string> paragraphs;
153 al::split(paragraphs, text, al::is_any_of(
"\n"));
156 for (
auto const& paragraph: paragraphs) {
157 vector<string> words;
158 al::split(words, paragraph, al::is_any_of(
" \t"), al::token_compress_on);
161 for (
auto const& word: words) {
162 size_t s = line.size() + word.size();
163 static const size_t sMax = po::options_description::m_default_line_length;
176 wrapped += line +
'\n';