|
| formatter (size_t column=80) |
| Constructs a formatter with a column defaulting to 80.
|
|
virtual | ~formatter ()=default |
| Virtual destructor.
|
|
virtual std::string | wrap (const std::string &str, size_t indent=0) |
| Wraps a string at the column point. More...
|
|
virtual std::string | usage (const std::string &name, const std::string &command, const std::string &str) |
| Handles the usage message. More...
|
|
virtual std::string | description (const std::string &str) |
| Handles the description message. More...
|
|
virtual std::string | epilogue (const std::string &str) |
| Handles the epilogue message. More...
|
|
virtual std::string | subcommands (const std::vector< subcommand > &subs) |
| Handles the list of subcommands. More...
|
|
virtual std::string | options (const option_set &opts) |
| Handles the list of options. More...
|
|
A class that handles the formatting of the help message. This class could be inherited and you could override its virtual member functions that handle the printing of the message. A default implementation is provided.
Definition at line 37 of file formatter.hpp.
virtual std::string gears::optparse::formatter::options |
( |
const option_set & |
opts | ) |
|
|
inlinevirtual |
Handles the list of options. This is typically printed after the list of subcommands, if applicable, or the description. This is also typically printed before the epilogue message. By default this returns a string of indented name-help indented pairs. Indentation defaults to 4 spaces.
For options, the default printing is as follows:
Long Form | Short Form | Metavar | Result |
"test" | 't' | "" | "-t, –test " |
"test" | '\0' | "" | " –test " |
"" | 't' | "" | "-t " |
"test" | 't' | "to" | "-t, –test[=<to>]" |
"" | 't' | "to" | "-t <to> " |
- Parameters
-
opts | The current list of active options. |
- Returns
- The resultant string.
Definition at line 214 of file formatter.hpp.