paludis Version 3.0.2
The one true package mangler
paludis::args::ArgsOption Class Referenceabstract

#include <args_option.hh>

Inheritance diagram for paludis::args::ArgsOption:

Public Member Functions

void remove ()
const std::string & long_name () const
char short_name () const
const std::string & description () const
virtual bool specified () const
virtual bool explicitly_specified () const
virtual void set_specified (const ArgsOptionSpecifiedness value)
ArgsGroup * group ()
virtual bool can_be_negated () const =0
virtual const std::string forwardable_string () const PALUDIS_ATTRIBUTE((warn_unused_result))=0
virtual const std::shared_ptr< Sequence< std::string > > forwardable_args () const PALUDIS_ATTRIBUTE((warn_unused_result))=0
Public Member Functions inherited from paludis::DeclareAbstractAcceptMethods< ArgsOption, MakeTypeList< StringArg, AliasArg, SwitchArg, IntegerArg, EnumArg, StringSetArg, StringSequenceArg >::Type >
void accept (UnwrappedVisitor_ &v)
Result_ accept_returning (UnwrappedVisitor_ &v, const Result_ &r=Result_())
auto make_accept_returning (const Case_ &firstcase, const Cases_ &... cases) const -> CallResultType< Case_ >
void make_accept (const Cases_ &... cases) const

Protected Member Functions

 ArgsOption (ArgsGroup *const, const std::string &long_name, const char short_name, const std::string &description)
virtual ~ArgsOption ()=default

Friends

class ArgsHandler

Additional Inherited Members

Public Types inherited from paludis::DeclareAbstractAcceptMethods< ArgsOption, MakeTypeList< StringArg, AliasArg, SwitchArg, IntegerArg, EnumArg, StringSetArg, StringSequenceArg >::Type >
typedef MakeTypeList< StringArg, AliasArg, SwitchArg, IntegerArg, EnumArg, StringSetArg, StringSequenceArg >::Type VisitableTypeList
typedef ArgsOption VisitableBaseClass

Detailed Description

Base class for a command line option.

Constructor & Destructor Documentation

◆ ArgsOption()

paludis::args::ArgsOption::ArgsOption ( ArgsGroup * const ,
const std::string & long_name,
const char short_name,
const std::string & description )
protected

Constructor.

References description(), long_name(), and short_name().

◆ ~ArgsOption()

virtual paludis::args::ArgsOption::~ArgsOption ( )
protectedvirtualdefault

Destructor.

Member Function Documentation

◆ can_be_negated()

virtual bool paludis::args::ArgsOption::can_be_negated ( ) const
pure virtual

◆ description()

const std::string & paludis::args::ArgsOption::description ( ) const
inline

◆ explicitly_specified()

virtual bool paludis::args::ArgsOption::explicitly_specified ( ) const
inlinevirtual

Fetch whether or not we were explicitly (not an env var) specified. Used to catch -x y -x z where -x takes a single value.

Reimplemented in paludis::args::AliasArg.

◆ forwardable_args()

virtual const std::shared_ptr< Sequence< std::string > > paludis::args::ArgsOption::forwardable_args ( ) const
pure virtual

Ourself as a sequence of strings.

For example, { '–foo', 'bar' } or { '–foo', 'bar', '–foo', 'baz' } if not specified, an empty sequence.

Since
0.46

Implemented in paludis::args::AliasArg, paludis::args::EnumArg, paludis::args::IntegerArg, paludis::args::StringArg, paludis::args::StringSequenceArg, paludis::args::StringSetArg, and paludis::args::SwitchArg.

References forwardable_args(), and PALUDIS_ATTRIBUTE.

Referenced by forwardable_args().

◆ forwardable_string()

virtual const std::string paludis::args::ArgsOption::forwardable_string ( ) const
pure virtual

Ourself as a forwardable string.

For example, '–foo bar' or '–foo bar –foo baz' or '–foo', or if not specified, the empty string.

Since
0.40

Implemented in paludis::args::AliasArg, paludis::args::EnumArg, paludis::args::IntegerArg, paludis::args::StringArg, paludis::args::StringSequenceArg, paludis::args::StringSetArg, and paludis::args::SwitchArg.

References PALUDIS_ATTRIBUTE.

◆ group()

ArgsGroup * paludis::args::ArgsOption::group ( )
inline

◆ long_name()

◆ remove()

void paludis::args::ArgsOption::remove ( )

Remove this option. Removes our group from its section if the group would be left empty.

◆ set_specified()

virtual void paludis::args::ArgsOption::set_specified ( const ArgsOptionSpecifiedness value)
inlinevirtual

Set the value returned by specified().

Reimplemented in paludis::args::AliasArg.

◆ short_name()

◆ specified()

virtual bool paludis::args::ArgsOption::specified ( ) const
inlinevirtual

Fetch whether or not we were specified on the command line (or as an env var).

Reimplemented in paludis::args::AliasArg.


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