From a58488dc0d93f8e98bdce3157b637c8a229cfde4 Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Sat, 4 Feb 2017 14:48:57 -0500 Subject: [PATCH] Don't make a new line unless needed --- include/CLI.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/CLI.hpp b/include/CLI.hpp index a61381eb..74046ea1 100644 --- a/include/CLI.hpp +++ b/include/CLI.hpp @@ -177,9 +177,11 @@ namespace detail { void format_help(std::stringstream &out, std::string name, std::string discription, size_t wid) { name = " " + name; out << std::setw(wid) << std::left << name; - if(name.length()>=wid) - out << std::endl << std::setw(wid) << ""; - out << discription << std::endl; + if(discription != "") { + if(name.length()>=wid) + out << std::endl << std::setw(wid) << ""; + out << discription << std::endl; + } } struct Combiner {