All Classes Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
gears::optparse::missing_required_value Class Reference

Exception thrown when a required value is missing.

Inherits gears::optparse::error.

Public Member Functions

 missing_required_value (const std::string &name, const std::string &op, size_t nargs)
 Constructs an exception. More...
 

Public Attributes

std::string program_name
 
std::string option_name
 
std::string error_string
 

Detailed Description

Definition at line 99 of file error.hpp.

Constructor & Destructor Documentation

gears::optparse::missing_required_value::missing_required_value ( const std::string &  name,
const std::string &  op,
size_t  nargs 
)
inline

Constructs an exception. The string printed depends on the number of arguments expected. If only nargs is equal to 1, then the error string is: "{name}: error: option '{op}' requires an argument". Otherwise the error string is "{name}: error: option '{op}' requires {narg} arguments"

Parameters
nameThe name of the program.
opThe option passed.
nargsThe number of arguments expected.

Definition at line 114 of file error.hpp.