mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 16:26:18 +02:00
Completions::add(): Guard against newlines
This commit is contained in:
parent
ea4b2b985f
commit
59bd6e87a4
1 changed files with 5 additions and 4 deletions
|
@ -19,10 +19,11 @@ void Args::addFlag(Flag && flag_)
|
||||||
|
|
||||||
void Completions::add(std::string completion, std::string description)
|
void Completions::add(std::string completion, std::string description)
|
||||||
{
|
{
|
||||||
insert(Completion{
|
assert(description.find('\n') == std::string::npos);
|
||||||
.completion = completion,
|
insert(Completion {
|
||||||
.description = description
|
.completion = completion,
|
||||||
});
|
.description = description
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Completion::operator<(const Completion & other) const
|
bool Completion::operator<(const Completion & other) const
|
||||||
|
|
Loading…
Reference in a new issue