Commit a58488dc0d93f8e98bdce3157b637c8a229cfde4

Authored by Henry Fredrick Schreiner
1 parent c028ca29

Don't make a new line unless needed

Showing 1 changed file with 5 additions and 3 deletions
include/CLI.hpp
@@ -177,9 +177,11 @@ namespace detail { @@ -177,9 +177,11 @@ namespace detail {
177 void format_help(std::stringstream &out, std::string name, std::string discription, size_t wid) { 177 void format_help(std::stringstream &out, std::string name, std::string discription, size_t wid) {
178 name = " " + name; 178 name = " " + name;
179 out << std::setw(wid) << std::left << name; 179 out << std::setw(wid) << std::left << name;
180 - if(name.length()>=wid)  
181 - out << std::endl << std::setw(wid) << "";  
182 - out << discription << std::endl; 180 + if(discription != "") {
  181 + if(name.length()>=wid)
  182 + out << std::endl << std::setw(wid) << "";
  183 + out << discription << std::endl;
  184 + }
183 } 185 }
184 186
185 struct Combiner { 187 struct Combiner {