cli11
Loading...
Searching...
No Matches
cli::required_error_t Class Referenceexport
module cli11

A required option or subcommand was not supplied. More...

Inheritance diagram for cli::required_error_t:
cli::detail::error_mixin_t< required_error_t, parse_error_t > cli::parse_error_t cli::detail::error_mixin_t< parse_error_t, error_t > cli::error_t

Public Member Functions

 required_error_t (const std::string &name)
 Constructs the error for a missing named entity.
Public Member Functions inherited from cli::detail::error_mixin_t< required_error_t, parse_error_t >
 error_mixin_t (std::string msg, exit_codes_t exit_code)
 Constructs the error, naming it from derived_t.
 error_mixin_t (std::string msg, int exit_code)
 Constructs the error, naming it from derived_t.
Public Member Functions inherited from cli::detail::error_mixin_t< parse_error_t, error_t >
 error_mixin_t (std::string msg, exit_codes_t exit_code)
 Constructs the error, naming it from derived_t.
 error_mixin_t (std::string msg, int exit_code)
 Constructs the error, naming it from derived_t.
Public Member Functions inherited from cli::error_t
auto get_exit_code () const -> int
 Returns the process exit code associated with this error.
auto get_name () const -> std::string
 Returns the short name of this error type.
 error_t (std::string name, std::string msg, int exit_code=static_cast< int >(exit_codes_t::base_class))
 Constructs an error with an explicit numeric exit code.
 error_t (std::string name, std::string msg, exit_codes_t exit_code)
 Constructs an error with an exit code drawn from exit_codes_t.

Static Public Member Functions

static auto subcommand (std::size_t min_subcom) -> required_error_t
 Too few subcommands were supplied.
static auto option (std::size_t min_option, std::size_t max_option, std::size_t used, const std::string &option_list) -> required_error_t
 The number of options used fell outside the permitted range.

Static Public Attributes

static constexpr std::string_view error_type_name = "required_error"
 Short name reported by error_t::get_name.
Static Public Attributes inherited from cli::parse_error_t
static constexpr std::string_view error_type_name = "parse_error"
 Short name reported by error_t::get_name.

Additional Inherited Members

Protected Member Functions inherited from cli::detail::error_mixin_t< required_error_t, parse_error_t >
 error_mixin_t (std::string ename, std::string msg, int exit_code)
 Forwards an explicit type name, for further derivation.
 error_mixin_t (std::string ename, std::string msg, exit_codes_t exit_code)
 Forwards an explicit type name, for further derivation.
Protected Member Functions inherited from cli::detail::error_mixin_t< parse_error_t, error_t >
 error_mixin_t (std::string ename, std::string msg, int exit_code)
 Forwards an explicit type name, for further derivation.
 error_mixin_t (std::string ename, std::string msg, exit_codes_t exit_code)
 Forwards an explicit type name, for further derivation.

Detailed Description

A required option or subcommand was not supplied.

Constructor & Destructor Documentation

◆ required_error_t()

cli::required_error_t::required_error_t ( const std::string & name)
inlineexplicit

Constructs the error for a missing named entity.

Parameters
nameThe entity that was required.

Member Function Documentation

◆ option()

auto cli::required_error_t::option ( std::size_t min_option,
std::size_t max_option,
std::size_t used,
const std::string & option_list ) -> required_error_t
inlinestaticnodiscard

The number of options used fell outside the permitted range.

Parameters
min_optionMinimum number of options required.
max_optionMaximum number of options permitted.
usedHow many were actually supplied.
option_listThe options the requirement applies to.
Returns
The constructed error.

◆ subcommand()

auto cli::required_error_t::subcommand ( std::size_t min_subcom) -> required_error_t
inlinestaticnodiscard

Too few subcommands were supplied.

Parameters
min_subcomThe minimum number required.
Returns
The constructed error.

The documentation for this class was generated from the following file:
  • /home/mccakit/desktop/repositories/cli11/src/error.cpp