#include <optparse.h>
Public Member Functions | |
Option (std::string shrt, std::string lng, std::string dest, std::string hlp, action_t act, std::string dfault, type_t type, std::string allowed_args) | |
~Option () | |
bool | is_allowed (std::string argument) |
Public Attributes | |
action_t | action |
std::string | shrt_flag |
std::string | lng_flag |
std::string | help |
std::string | destination |
std::string | dfault_ |
type_t | type_ |
std::string | allowed_args_ |
Comma-separated list of allowed option arguments. |
Definition at line 43 of file optparse.h.
optparse::Option::Option | ( | std::string | shrt, | |
std::string | lng, | |||
std::string | dest, | |||
std::string | hlp, | |||
action_t | act, | |||
std::string | dfault, | |||
type_t | type, | |||
std::string | allowed_args | |||
) |
optparse::Option::~Option | ( | ) |
Definition at line 30 of file optparse.cpp.
bool optparse::Option::is_allowed | ( | std::string | argument | ) |
Validate option argument. Test if argument is valid for the option. The argument must be valid w.r.t. to type_ and allowed_values_.
argument | Argument to be tested. |
Definition at line 33 of file optparse.cpp.
References allowed_args_.
Referenced by optparse::OptionParser::set_option().
Definition at line 59 of file optparse.h.
std::string optparse::Option::allowed_args_ |
Comma-separated list of allowed option arguments.
Definition at line 74 of file optparse.h.
Referenced by is_allowed().
std::string optparse::Option::destination |
std::string optparse::Option::dfault_ |
Default value. An empty string means no default value exist.
Definition at line 67 of file optparse.h.
std::string optparse::Option::help |
Definition at line 62 of file optparse.h.
std::string optparse::Option::lng_flag |
Definition at line 61 of file optparse.h.
std::string optparse::Option::shrt_flag |
Definition at line 60 of file optparse.h.
Expected type the argument of this option should have. Only relevant for STORE action. Used for generating the usage string.
Definition at line 73 of file optparse.h.