Completions::add(): Guard against newlines

This commit is contained in:
Eelco Dolstra 2020-10-09 21:55:59 +02:00
parent ea4b2b985f
commit 59bd6e87a4

View File

@ -19,10 +19,11 @@ void Args::addFlag(Flag && flag_)
void Completions::add(std::string completion, std::string description)
{
insert(Completion{
.completion = completion,
.description = description
});
assert(description.find('\n') == std::string::npos);
insert(Completion {
.completion = completion,
.description = description
});
}
bool Completion::operator<(const Completion & other) const