From f75feab968a614ed050f68f8019d04337cd1c25b Mon Sep 17 00:00:00 2001 From: parkertomatoes Date: Sun, 7 Oct 2018 20:57:33 -0400 Subject: [PATCH] Handle newlines in description (#138) --- include/cxxopts.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index d56f194..e4bb8c3 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -1415,7 +1415,12 @@ namespace cxxopts lastSpace = current; } - if (size > width) + if (*current == '\n') + { + startLine = current + 1; + lastSpace = startLine; + } + else if (size > width) { if (lastSpace == startLine) { -- libgit2 0.21.4