cmd line parser
More...
#include <dx_parser.h>
|
| struct | dispatch |
| | one command: what it runs, how it reads in the help, and the commands nested under it. A word of parameter consumes the arguments that follow it before this one's own function runs, which is what makes the CLI hierarchical More...
|
|
| typedef std::deque< std::string > | args |
◆ args
◆ parser()
| dx::parser::parser |
( |
const char * | name, |
|
|
const decltype(dictionary)& | dictionary = {} ) |
|
inline |
◆ ~parser()
| virtual dx::parser::~parser |
( |
| ) |
|
|
virtualdefault |
◆ head()
| virtual bool dx::parser::head |
( |
| ) |
const |
|
inlineprotectedvirtualnoexcept |
◆ help()
| virtual void dx::parser::help |
( |
args & | args | ) |
|
|
inlineprotectedvirtual |
◆ help_head()
| virtual void dx::parser::help_head |
( |
| ) |
const |
|
inlineprotectedvirtualnoexcept |
◆ indent()
| virtual void dx::parser::indent |
( |
args & | args | ) |
|
|
inlineprotectedvirtual |
◆ no_args()
| virtual void dx::parser::no_args |
( |
const args & | args | ) |
|
|
inlineprotectedvirtual |
◆ operator<<() [1/2]
| virtual void dx::parser::operator<< |
( |
args & | args | ) |
|
|
inlinevirtual |
◆ operator<<() [2/2]
| virtual void dx::parser::operator<< |
( |
const args & | args | ) |
|
|
inlinevirtual |
◆ quiet()
| virtual void dx::parser::quiet |
( |
const args & | = {} | ) |
|
|
inlinevirtualnoexcept |
◆ select()
| auto dx::parser::select |
( |
const std::string & | id | ) |
|
|
inlineprotected |
◆ version()
| virtual void dx::parser::version |
( |
const args & | args = {} | ) |
|
|
inlineprotectedvirtual |
◆ dictionary
| std::map<std::deque<std::string>, dispatch> dx::parser::dictionary |
|
protected |
Initial value:{
{{"--continue", "--no-error", "--ignore", "--ignore-error"},
{{
"--indent",
"--tab"}, {std::bind(&
parser::indent,
this, std::placeholders::_1),
"set/get indention width and pattern",
"[width [pattern]]", {},{
{{
"err",
"stderr"}, {[
this](
args&){this->
parameter.log.err=
true;},
"select std error"}},
{{
"log",
"stdlog"}, {[
this](
args&){this->
parameter.log.log=
true;},
"select std log"}},
{{
"out",
"stdout"}, {[
this](
args&){this->
parameter.log.out=
true;},
"select std out"}},
}}},
{{
"--quiet",
"-q"}, {std::bind(&
parser::quiet,
this, std::placeholders::_1),
"quiet!"}},
{{
"--version",
"-v"}, {std::bind(&
parser::version,
this, std::placeholders::_1), std::string{
"display "}+
name+
" version"}},
}
virtual void indent(args &args)
Definition dx_parser.h:235
virtual void no_args(const args &args)
Definition dx_parser.h:228
const char * name
Definition dx_parser.h:64
bool quiet
Definition dx_parser.h:66
std::deque< std::string > args
Definition dx_parser.h:60
struct dx::parser::@046247176025362246310022157273031025265032273157 parameter
virtual void version(const args &args={})
Definition dx_parser.h:261
◆ err
◆ [struct]
| struct { ... } dx::parser::error |
◆ ignore
◆ [struct] [1/2]
| struct { ... } dx::parser::log |
◆ log [2/2]
◆ mask
◆ name
| const char* dx::parser::name {} |
|
protected |
◆ out
◆ [struct]
| struct { ... } dx::parser::parameter |
◆ quiet
The documentation for this class was generated from the following file: