CLI11
C++11 Command Line Interface Parser
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CLI::OptionBase< CRTP > Class Template Reference

#include <Option.hpp>

Public Member Functions

CRTP * group (const std::string &name)
 Changes the group membership.
 
CRTP * required (bool value=true)
 Set the option as required.
 
CRTP * mandatory (bool value=true)
 Support Plumbum term.
 
CRTP * always_capture_default (bool value=true)
 
CLI11_NODISCARD const std::string & get_group () const
 Get the group of this option.
 
CLI11_NODISCARD bool get_required () const
 True if this is a required option.
 
CLI11_NODISCARD bool get_ignore_case () const
 The status of ignore case.
 
CLI11_NODISCARD bool get_ignore_underscore () const
 The status of ignore_underscore.
 
CLI11_NODISCARD bool get_configurable () const
 The status of configurable.
 
CLI11_NODISCARD bool get_disable_flag_override () const
 The status of configurable.
 
CLI11_NODISCARD char get_delimiter () const
 Get the current delimiter char.
 
CLI11_NODISCARD bool get_always_capture_default () const
 Return true if this will automatically capture the default value for help printing.
 
CLI11_NODISCARD MultiOptionPolicy get_multi_option_policy () const
 The status of the multi option policy.
 
CRTP * take_last ()
 Set the multi option policy to take last.
 
CRTP * take_first ()
 Set the multi option policy to take last.
 
CRTP * take_all ()
 Set the multi option policy to take all arguments.
 
CRTP * join ()
 Set the multi option policy to join.
 
CRTP * join (char delim)
 Set the multi option policy to join with a specific delimiter.
 
CRTP * configurable (bool value=true)
 Allow in a configuration file.
 
CRTP * delimiter (char value='\0')
 Allow in a configuration file.
 

Protected Member Functions

template<typename T >
void copy_to (T *other) const
 Copy the contents to another similar class (one based on OptionBase)
 

Protected Attributes

std::string group_ = std::string("OPTIONS")
 The group membership.
 
bool required_ {false}
 True if this is a required option.
 
bool ignore_case_ {false}
 Ignore the case when matching (option, not value)
 
bool ignore_underscore_ {false}
 Ignore underscores when matching (option, not value)
 
bool configurable_ {true}
 Allow this option to be given in a configuration file.
 
bool disable_flag_override_ {false}
 Disable overriding flag values with '=value'.
 
char delimiter_ {'\0'}
 Specify a delimiter character for vector arguments.
 
bool always_capture_default_ {false}
 Automatically capture default value.
 
MultiOptionPolicy multi_option_policy_ {MultiOptionPolicy::Throw}
 Policy for handling multiple arguments beyond the expected Max.
 

Detailed Description

template<typename CRTP>
class CLI::OptionBase< CRTP >

This is the CRTP base class for Option and OptionDefaults. It was designed this way to share parts of the class; an OptionDefaults can copy to an Option.


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