Skip to content
Snippets Groups Projects
Commit 6d0df5d6 authored by Martin Wölzer's avatar Martin Wölzer
Browse files

src/include/clapp/parser.hpp: simplified if-condition and improved exception message

parent 932c2573
1 merge request!22Add support for option-container
Pipeline #663 passed with stages
in 1 day, 6 hours, 52 minutes, and 6 seconds
......@@ -23,10 +23,9 @@
template <clapp::parser::types::argument_type_t argument_type>
void clapp::parser::basic_parser_t::reg(
types::basic_reg_argument_conf_t<argument_type>&& config) {
if (config.argument_name.size() == 0) {
if (config.argument_name.empty()) {
std::stringstream string_stream;
string_stream << "Argument name '" << config.argument_name
<< "' is too short.";
string_stream << "Argument name must be at least one char long.";
throw clapp::exception::argument_exception_t{string_stream.str()};
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment