29 const std::string_view arg_name,
const std::string_view reason
32 std::format(
"Given name [{}] is invalid.\nReason: {}", arg_name, reason)
47 return parsing_failure(std::format(
"Unknown argument [{}].", arg_name));
53 if (std::is_lt(ordering))
55 std::format(
"Not enough values provided for argument [{}]", arg_name.str())
58 if (std::is_gt(ordering))
60 std::format(
"Too many values provided for argument [{}]", arg_name.str())
64 std::format(
"Invalid number of values provided for argument [{}]", arg_name.str())
77 "Invalid value type specified for argument [{}] = {}.",
83 template <
typename Inval
idType>
86 "Invalid value type specified for argument [{}] = {}.",
88 util::get_demangled_type_name<InvalidType>()
98 return lookup_failure(std::format(
"Argument with given name [{}] not found.", arg_name));
Provides common string utility functions.
Base type for the argument parser functionality errors/exceptions.
argument_parser_exception(const std::string &message)
Structure holding the argument's name.
Exception type used for invalid configuration of an argument parser or its arguments.
static invalid_configuration argument_name_used(const detail::argument_name &arg_name) noexcept
invalid_configuration(const std::string &message)
static invalid_configuration invalid_argument_name(const std::string_view arg_name, const std::string_view reason) noexcept
Exception type used for element lookup errors.
lookup_failure(const std::string &message)
static lookup_failure argument_not_found(const std::string_view &arg_name) noexcept
Exception type used for errors encountered during the argument parsing operation.
static parsing_failure invalid_nvalues(const detail::argument_name &arg_name, const std::weak_ordering ordering) noexcept
static parsing_failure unknown_argument(const std::string_view arg_name) noexcept
parsing_failure(const std::string &message)
Exception type used for type-related errors.
type_error(const std::string &message)
static type_error invalid_value_type(const detail::argument_name &arg_name, const std::type_info &value_type) noexcept
static type_error invalid_value_type(const detail::argument_name &arg_name) noexcept
Provides common typing utility functions.