CAF 0.17.6
|
Stores the name of a command line option ("<long name>[,<short name>]") along with a description and a callback. More...
#include <message.hpp>
Public Types | |
using | consumer = std::function< bool(const std::string &)> |
Returns true on a match, false otherwise. | |
Public Member Functions | |
cli_arg (std::string nstr, std::string tstr) | |
Creates a CLI argument without data. | |
cli_arg (std::string nstr, std::string tstr, bool &arg) | |
Creates a CLI flag option. | |
cli_arg (std::string nstr, std::string tstr, atom_value &arg) | |
Creates a CLI argument storing its matched argument in dest . | |
cli_arg (std::string nstr, std::string tstr, timespan &arg) | |
Creates a CLI argument storing its matched argument in dest . | |
cli_arg (std::string nstr, std::string tstr, std::string &arg) | |
Creates a CLI argument storing its matched argument in dest . | |
cli_arg (std::string nstr, std::string tstr, std::vector< std::string > &arg) | |
Creates a CLI argument appending matched arguments to dest . | |
cli_arg (std::string nstr, std::string tstr, consumer f) | |
Creates a CLI argument using the function object f . | |
template<class T > | |
cli_arg (std::string nstr, std::string tstr, T &arg) | |
Creates a CLI argument for converting from strings, storing its matched argument in dest . | |
template<class T > | |
cli_arg (std::string nstr, std::string tstr, std::vector< T > &arg) | |
Creates a CLI argument for converting from strings, appending matched arguments to dest . | |
Public Attributes | |
std::string | name |
Full name of this CLI argument using format "<long name>[,<short name>]". | |
std::string | text |
Desciption of this CLI argument for the auto-generated help text. | |
std::string | helptext |
Auto-generated helptext for this item. | |
consumer | fun |
Evaluates option arguments. | |
bool * | flag |
Set to true for zero-argument options. | |
Stores the name of a command line option ("<long name>[,<short name>]") along with a description and a callback.
caf::message::cli_arg::cli_arg | ( | std::string | nstr, |
std::string | tstr, | ||
bool & | arg | ||
) |
Creates a CLI flag option.
The flag
is set to true
if the option was set, otherwise it is false
.