@@ -33,11 +33,10 @@ namespace GridKit
3333 return os;
3434 }
3535
36- inline const std::string&
37- typeString (const Argument& arg)
36+ inline const std::string& typeString (const Argument& arg)
3837 {
3938 static const std::string labelArray[] =
40- {" STR " , " REAL" , " INT" , " BOOL" , " UNSPECIFIED" };
39+ {" STRING " , " REAL" , " INT" , " BOOL" , " UNSPECIFIED" };
4140 return labelArray[static_cast <int >(arg.type )];
4241 }
4342
@@ -225,20 +224,17 @@ namespace GridKit
225224 // This is stolen (and simplified) from Boost.ProgramOptions
226225 inline constexpr unsigned defaultLineLength = 80 ;
227226
228- unsigned
229- getLineLength ()
227+ unsigned getLineLength ()
230228 {
231229 return defaultLineLength;
232230 }
233231
234- unsigned
235- getMinHelpLength ()
232+ unsigned getMinHelpLength ()
236233 {
237234 return defaultLineLength / 2 ;
238235 }
239236
240- std::string
241- formatFirstColumn (const Argument& arg)
237+ std::string formatFirstColumn (const Argument& arg)
242238 {
243239 std::stringstream ss;
244240 ss << " " ;
@@ -254,11 +250,9 @@ namespace GridKit
254250 return ss.str ();
255251 }
256252
257- unsigned
258- getArgColumnWidth (
259- const std::vector<Argument>& args,
260- const unsigned lineLength,
261- const unsigned minHelpLength)
253+ unsigned getArgColumnWidth (const std::vector<Argument>& args,
254+ const unsigned lineLength,
255+ const unsigned minHelpLength)
262256 {
263257 const unsigned startOfHelpColumn = lineLength - minHelpLength;
264258
@@ -279,14 +273,15 @@ namespace GridKit
279273 return width;
280274 }
281275
282- void
283- leftPad (std::ostream& os, unsigned width)
276+ void leftPad (std::ostream& os, unsigned width)
284277 {
285278 os << std::setfill (' ' ) << std::setw (width) << " " ;
286279 }
287280
288- void
289- printParagraph (std::ostream& os, std::string_view par, unsigned indent, unsigned lineLength)
281+ void printParagraph (std::ostream& os,
282+ std::string_view par,
283+ unsigned indent,
284+ unsigned lineLength)
290285 {
291286 // Through remainder of this function, 'lineLength' will be the length
292287 // available for characters, not including indent.
@@ -350,8 +345,10 @@ namespace GridKit
350345 }
351346 }
352347
353- void
354- printArgHelp (std::ostream& os, const std::string& desc, unsigned firstColWidth, unsigned lineLength)
348+ void printArgHelp (std::ostream& os,
349+ const std::string& desc,
350+ unsigned firstColWidth,
351+ unsigned lineLength)
355352 {
356353 // we need to use one char less per line to work correctly if actual
357354 // console has longer lines
@@ -376,8 +373,10 @@ namespace GridKit
376373 }
377374 }
378375
379- void
380- printArg (std::ostream& os, const Argument& arg, unsigned firstColWidth, unsigned lineLength)
376+ void printArg (std::ostream& os,
377+ const Argument& arg,
378+ unsigned firstColWidth,
379+ unsigned lineLength)
381380 {
382381 auto c1 = formatFirstColumn (arg);
383382 os << c1;
@@ -438,14 +437,19 @@ namespace GridKit
438437 return ss.str ();
439438 }
440439
441- void CliArgs::printHelp (std::ostream& os) const
440+ void CliArgs::printUsage (std::ostream& os) const
442441 {
443442 os << " Usage: " << app_name_;
444443 for (auto && arg : table_)
445444 {
446445 os << " " << formatArgUsage (arg);
447446 }
448447 os << " \n\n " ;
448+ }
449+
450+ void CliArgs::printHelp (std::ostream& os) const
451+ {
452+ printUsage (os);
449453
450454 auto lineLength = getLineLength ();
451455 auto minHelpLength = getMinHelpLength ();
0 commit comments