args-parser 6.3.3
Loading...
Searching...
No Matches
Args::Help Class Reference

Help argument. More...

#include <help.hpp>

+ Inheritance diagram for Args::Help:
+ Collaboration diagram for Args::Help:

Public Member Functions

 Help (bool throwExceptionOnPrint=true)
 
void setExecutable (const String &exe)
 Set executable name.
 
void setAppDescription (const String &desc)
 Set description for the application.
 
void setLineLength (String::size_type length)
 Set line length for the help.
 
void setPrinter (std::unique_ptr< HelpPrinterIface > p)
 Set printer.
 
- Public Member Functions inherited from Args::Arg
template<typename T >
 Arg (Char flag, T &&name, bool isWithValue=false, bool isRequired=false)
 Construct argument with flag and name.
 
 Arg (Char flag, bool isWithValue=false, bool isRequired=false)
 Construct argument only with flag, without name.
 
template<typename T >
 Arg (T &&name, bool isWithValue=false, bool isRequired=false)
 Construct argument only with name, without flag.
 
virtual ~Arg ()
 
ArgType type () const override
 
String name () const override
 
bool isWithValue () const override
 
void setWithValue (bool on=true)
 Set is this argument with value.
 
bool isRequired () const override
 
void setRequired (bool on=true)
 Set required.
 
bool isDefined () const override
 
void setDefined (bool on=true)
 Set defined.
 
virtual const Stringvalue () const
 
virtual void setValue (const String &v)
 Set value.
 
const Stringflag () const override
 
void setFlag (Char f)
 Set flag.
 
const StringargumentName () const override
 
void setArgumentName (const String &name)
 Set argument name.
 
const StringvalueSpecifier () const override
 
void setValueSpecifier (const String &vs)
 Set value specifier.
 
const Stringdescription () const override
 
void setDescription (const String &desc)
 Set description.
 
const StringlongDescription () const override
 
void setLongDescription (const String &desc)
 Set long description.
 
virtual const StringdefaultValue () const
 
virtual void setDefaultValue (const String &v)
 Set default value.
 
bool isMisspelledName (const String &name, StringList &possibleNames) const override
 
void clear () override
 Clear state of the argument.
 
- Public Member Functions inherited from Args::ArgIface
 ArgIface ()
 
virtual ~ArgIface ()
 
CmdLinecmdLine () const
 

Protected Member Functions

void process (Context &context) override
 Process argument's staff, for example take values from context.
 
void setCmdLine (CmdLine *cmdLine) override
 Set command line parser.
 
- Protected Member Functions inherited from Args::Arg
ArgIfacefindArgument (const String &name) override
 
void checkCorrectnessBeforeParsing (StringList &flags, StringList &names) const override
 Check correctness of the argument before parsing.
 
void checkCorrectnessAfterParsing () const override
 Check correctness of the argument after parsing.
 

Detailed Description

Help argument.

Definition at line 74 of file help.hpp.

Constructor & Destructor Documentation

◆ Help()

Args::Help::Help ( bool  throwExceptionOnPrint = true)
inlineexplicit

Definition at line 809 of file cmd_line.hpp.

Member Function Documentation

◆ process()

void Args::Help::process ( Context context)
inlineoverrideprotectedvirtual

Process argument's staff, for example take values from context.

This method invokes exactly at that moment when parser has found this argument.

Parameters
contextContext of the command line.

Reimplemented from Args::Arg.

Definition at line 147 of file help.hpp.

◆ setAppDescription()

void Args::Help::setAppDescription ( const String desc)
inline

Set description for the application.

Definition at line 129 of file help.hpp.

◆ setCmdLine()

void Args::Help::setCmdLine ( CmdLine cmdLine)
inlineoverrideprotectedvirtual

Set command line parser.

Reimplemented from Args::ArgIface.

Definition at line 103 of file help.hpp.

◆ setExecutable()

void Args::Help::setExecutable ( const String exe)
inline

Set executable name.

Definition at line 123 of file help.hpp.

◆ setLineLength()

void Args::Help::setLineLength ( String::size_type  length)
inline

Set line length for the help.

Definition at line 135 of file help.hpp.

◆ setPrinter()

void Args::Help::setPrinter ( std::unique_ptr< HelpPrinterIface p)
inline

Set printer.

Definition at line 141 of file help.hpp.


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