From 6d0df5d62b07c15e13ba0fe3a76902bc01f9b7b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20W=C3=B6lzer?= <martin@libclapp.org> Date: Sat, 23 Sep 2023 21:45:56 +0200 Subject: [PATCH] src/include/clapp/parser.hpp: simplified if-condition and improved exception message --- src/include/clapp/parser.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/include/clapp/parser.hpp b/src/include/clapp/parser.hpp index b33eec97..04bb198b 100644 --- a/src/include/clapp/parser.hpp +++ b/src/include/clapp/parser.hpp @@ -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()}; } -- GitLab