#include <args_option.hh>
Iterate over our allowed arguments and associated descriptions | |
typedef WrappedForwardIterator < AllowedArgConstIteratorTag, const AllowedEnumArg > | AllowedArgConstIterator |
AllowedArgConstIterator | begin_allowed_args () const |
AllowedArgConstIterator | end_allowed_args () const |
Public Member Functions | |
EnumArg (ArgsGroup *const group, const std::string &long_name, const char short_name, const std::string &description, const EnumArgOptions &opts, const std::string &default_arg) | |
const std::string & | argument () const |
void | set_argument (const std::string &arg) |
void | set_default_arg (const std::string &arg) |
const std::string & | default_arg () const |
virtual bool | can_be_negated () const |
virtual const std::string | forwardable_string () const PALUDIS_ATTRIBUTE((warn_unused_result)) |
Classes | |
class | EnumArgOptions |
paludis::args::EnumArg::EnumArg | ( | ArgsGroup *const | group, | |
const std::string & | long_name, | |||
const char | short_name, | |||
const std::string & | description, | |||
const EnumArgOptions & | opts, | |||
const std::string & | default_arg | |||
) |
Constructor.
const std::string& paludis::args::EnumArg::argument | ( | ) | const [inline] |
Fetch the argument that was given to this option.
void paludis::args::EnumArg::set_argument | ( | const std::string & | arg | ) |
Set the argument returned by argument(), having verified that it is one of the arguments allowed for this option.
void paludis::args::EnumArg::set_default_arg | ( | const std::string & | arg | ) |
Change the default option (should be called before set_argument()).
const std::string& paludis::args::EnumArg::default_arg | ( | ) | const [inline] |
Fetch the default option, as specified to the constructor or set_default_arg().
virtual bool paludis::args::EnumArg::can_be_negated | ( | ) | const [virtual] |
virtual const std::string paludis::args::EnumArg::forwardable_string | ( | ) | const [virtual] |
Ourself as a forwardable string.
For example, '--foo bar' or '--foo bar --foo baz' or '--foo', or if not specified, the empty string.
Implements paludis::args::ArgsOption.