YesChief!
C++ argv parser
Loading...
Searching...
No Matches
yeschief::OptionGroup Class Referencefinal

#include <yeschief.h>

Public Member Functions

 OptionGroup (CLI *parent, std::string name)
 
template<typename T = bool>
auto addOption (const std::string &name, const std::string &description, const OptionConfiguration &configuration={}) -> OptionGroup &
 

Detailed Description

Represents a group of options under the same namespace

Constructor & Destructor Documentation

◆ OptionGroup()

yeschief::OptionGroup::OptionGroup ( CLI * parent,
std::string name )
explicit
Parameters
parentOwner of this group
nameName of this group

Member Function Documentation

◆ addOption()

template<typename T>
auto yeschief::OptionGroup::addOption ( const std::string & name,
const std::string & description,
const OptionConfiguration & configuration = {} ) -> OptionGroup &

Add an option to your group.

The name of the option can be written in 2 ways:

  • "name" -> for --name
  • "name,n" -> for --name and -n

For the second way, the format should always be <long>,<short>. For the long name you can have any length but the short name must be only 1 letter

Parameters
nameName of the option
descriptionDescription of the option
configurationAdvanced configuration
Returns
The OptionGroup object itself to chain calls

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