|
FE 0.13.1
Header-only C++ frontend library
|
Holds the Opts, parses argc/argv, and renders the help. More...
#include <fe/cli.h>
Public Member Functions | |
| Cli ()=default | |
| Cli (std::string prog, std::string descr={}) | |
| Cli & | add (Opt o) |
| std::optional< std::string > | parse (int argc, const char *const *argv) |
| Parses argc/argv; returns the error message - and nothing at all if all went well. | |
| void | help (std::ostream &) const |
| Renders the help for a terminal. | |
| void | markdown (std::ostream &) const |
| Renders the same information as Doxygen-flavored Markdown tables. | |
Add Option, Group, Section, or Epilog | |
| Cli & | add (Group g) |
| Cli & | operator| (Opt o) & |
| Cli & | operator| (Group g) & |
| Cli && | operator| (Opt o) && |
| Cli && | operator| (Group g) && |
| Cli & | section (std::string title, std::string head, std::vector< std::pair< std::string, std::string > > rows) |
A titled table of term/description rows that are not Opts - ENVIRONMENT, plugin arguments, ... Both backends render it below the options; head names the first column in Cli::markdown. | |
| Cli & | epilog (std::string s) |
| Text printed below the option list. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Cli &cli) |
|
default |
Referenced by add(), add(), epilog(), operator<<, operator|(), operator|(), operator|(), operator|(), and section().
|
inline |
Definition at line 211 of file cli.h.
References Cli(), and fe::cli::Group::name.
Definition at line 203 of file cli.h.
References Cli().
Referenced by operator|(), operator|(), operator|(), and operator|().
|
inline |
| void fe::cli::Cli::help | ( | std::ostream & | ) | const |
Renders the help for a terminal.
| void fe::cli::Cli::markdown | ( | std::ostream & | ) | const |
Renders the same information as Doxygen-flavored Markdown tables.
| std::optional< std::string > fe::cli::Cli::parse | ( | int | argc, |
| const char *const * | argv ) |
Parses argc/argv; returns the error message - and nothing at all if all went well.
|
inline |
A titled table of term/description rows that are not Opts - ENVIRONMENT, plugin arguments, ... Both backends render it below the options; head names the first column in Cli::markdown.
Pass no rows to get a bare header that groups the Sections below it - one level up in Cli::markdown.
Definition at line 220 of file cli.h.
References Cli().
|
friend |