libcaf  0.13.2
Public Member Functions | Public Attributes | List of all members
caf::message::cli_arg Struct Reference

Stores the name of a command line option ("<long name>[,<short name>]") along with a description and a callback. More...

#include <message.hpp>

Public Member Functions

 cli_arg (std::string name, std::string text)
 Creates a CLI argument without data.
 
 cli_arg (std::string name, std::string text, std::string &dest)
 Creates a CLI argument storing its matched argument in dest.
 
 cli_arg (std::string name, std::string text, std::vector< std::string > &dest)
 Creates a CLI argument appending matched arguments to dest.
 
template<class T >
 cli_arg (std::string name, std::string text, T &dest)
 Creates a CLI argument for converting from strings, storing its matched argument in dest. More...
 
template<class T >
 cli_arg (std::string name, std::string text, std::vector< T > &dest)
 Creates a CLI argument for converting from strings, appending matched arguments to dest. More...
 

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.
 
std::function< bool(const std::string &)> fun
 Returns true on a match, false otherwise.
 

Detailed Description

Stores the name of a command line option ("<long name>[,<short name>]") along with a description and a callback.

Constructor & Destructor Documentation

template<class T >
caf::message::cli_arg::cli_arg ( std::string  name,
std::string  text,
T &  dest 
)

Creates a CLI argument for converting from strings, storing its matched argument in dest.

template<class T >
caf::message::cli_arg::cli_arg ( std::string  name,
std::string  text,
std::vector< T > &  dest 
)

Creates a CLI argument for converting from strings, appending matched arguments to dest.


The documentation for this struct was generated from the following file: