56 const char*
what() const noexcept
override {
87 command_error(std::string(
"The flag argument ") + flag +
" is unknown") {
95 command_error(std::string(
"The named argument ") + name +
" is unknown") {
148 if (count < expected) {
150 m_what +=
" is required to occur at least " + std::to_string(expected) +
" times";
156 m_what +=
" can occur at most " + std::to_string(expected) +
" times";
158 m_what +=
" can only be set once";
175 argument_error(arg, std::string(
"does not accept the value ") + value) {
218 constraint_error(
const std::string& reason,
const std::vector<const BaseArgument*>& args);
argument_invalid_value(const Argument &arg, const std::string &value)
Creates the exception for the given argument, with the incorrect value.
Definition: Exceptions.hpp:174
Exception class raised when an argument value is given but not expected.
Definition: Exceptions.hpp:196
Exception class raised when an error occurs verifying a command line argument.
Definition: Exceptions.hpp:103
std::string m_what
Description of the exception.
Definition: Exceptions.hpp:39
argument_count_mismatch(const Argument &arg, unsigned int count, unsigned int expected)
Creates the exception for the given argument, with the number of occurrences and the expected number ...
Definition: Exceptions.hpp:146
exception(std::string what)
Creates the exception with the given message.
Definition: Exceptions.hpp:46
std::unique_ptr< Argument > m_arg
Copy of the argument involved in the error.
Definition: Exceptions.hpp:106
unknown_argument(char flag)
Creates the exception for flag arguments.
Definition: Exceptions.hpp:86
Simple argument class.
Definition: Argument.hpp:48
constraint_error(const std::string &reason, const std::vector< const BaseArgument * > &args)
Creates the exception with a reason for a constraint failure, and the list of arguments involved...
Standard exception class for TAP.
Definition: Exceptions.hpp:36
unknown_argument(std::string name)
Creates the exception for name arguments.
Definition: Exceptions.hpp:94
argument_no_value(const Argument &arg)
Creates the exception for the given argument, which was given a value but does not accept one...
Definition: Exceptions.hpp:202
argument_missing_value(const Argument &arg)
Creates the exception for the given argument, which misses a value.
Definition: Exceptions.hpp:188
Exception class raised when an argument value is incorrect.
Definition: Exceptions.hpp:167
Exception class raised when an argument is used an incorrect amount of times.
Definition: Exceptions.hpp:136
Exception class raised when an argument value is missing from the command line.
Definition: Exceptions.hpp:183
const char * what() const noexceptoverride
See std::exception::what().
Definition: Exceptions.hpp:56
Exception class raised when an unknown argument is encountered.
Definition: Exceptions.hpp:73
const Argument & arg() const
Returns the argument triggering the error.
Definition: Exceptions.hpp:127
Exception class for errors in the command line (such as unknown arguments or syntax errors)...
Definition: Exceptions.hpp:65
unknown_argument()
Creates the exception for positional arguments.
Definition: Exceptions.hpp:78
argument_error(const Argument &arg)
Creates the exception for the given argument, without a specified reason.
exception()
Creates the exception with no message.
Definition: Exceptions.hpp:51
Exception class raised when an argument constraint is not satisfied.
Definition: Exceptions.hpp:210