diff --git a/eo/src/utils/eoParser.cpp b/eo/src/utils/eoParser.cpp index 7150882a..4bab23f2 100644 --- a/eo/src/utils/eoParser.cpp +++ b/eo/src/utils/eoParser.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include @@ -49,7 +50,22 @@ std::ostream& printSectionHeader(std::ostream& os, std::string section) if (section == "") section = "General"; - os << '\n' << setw(10) << "###### " << setw(20) << section << setw(10) << " ######\n"; + // convert each character to upper case + std::transform( section.begin(), section.end(), section.begin(), ::toupper); + + // the formating with setfill would not permits to add this extra space as + // one more call to stream operator, thus it is inserted here + section += ' '; + + // pretty print so as to print the section, followed by as many # as + // necessary to fill the line until 80 characters + os << std::endl + << "### " + << std::left + << std::setfill('#') + << std::setw(80) // TODO do not hard code the width of the line + << section + << std::endl; return os; } @@ -334,8 +350,8 @@ void eoParser::printHelp(ostream& os) os << "--" <second->longName() <<":\t" << p->second->description() ; - os << "\n" << setw(20) << ( (p->second->required())?"Required":"Optional" ); - os <<". By default: "<second->defValue() << '\n'; + os << " (" << ( (p->second->required())?"Required":"Optional" ); + os <<", default: "<< p->second->defValue() << ')' << std::endl; } // for p os << "\n@param_file \t defines a file where the parameters are stored\n";