1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-05-01 05:03:52 +00:00

Don't make a new line unless needed

This commit is contained in:
Henry Fredrick Schreiner 2017-02-04 14:48:57 -05:00
parent c028ca298d
commit a58488dc0d

View File

@ -177,9 +177,11 @@ namespace detail {
void format_help(std::stringstream &out, std::string name, std::string discription, size_t wid) { void format_help(std::stringstream &out, std::string name, std::string discription, size_t wid) {
name = " " + name; name = " " + name;
out << std::setw(wid) << std::left << name; out << std::setw(wid) << std::left << name;
if(name.length()>=wid) if(discription != "") {
out << std::endl << std::setw(wid) << ""; if(name.length()>=wid)
out << discription << std::endl; out << std::endl << std::setw(wid) << "";
out << discription << std::endl;
}
} }
struct Combiner { struct Combiner {