feat: added additional checks

master v0.1.0
cobrapitz 3 years ago
parent c445ba4477
commit 35a4175582

@ -16,6 +16,13 @@ void cb::argparser::ArgumentParser::add_argument(const std::string &short_name,
throw std::runtime_error(error_message);
}
if (mode == Mode::POSITIONAL) {
assert(short_name.empty() && "The name should be left empty if it's a positional argument!");
assert(name.empty() && "The name should be left empty if it's a positional argument!");
} else {
assert(!name.empty() && "long name should never be empty!");
}
ParseArgument argument{};
argument.short_name = short_name;
argument.name = name;

Loading…
Cancel
Save