Re-add the ad-hoc command the was removed by mistake in the previous commit

Thank you, e2e tests
This commit is contained in:
louiz’
2016-09-29 23:10:41 +02:00
parent ee4cf5dc2d
commit 265b5df61b
2 changed files with 4 additions and 1 deletions
@@ -17,6 +17,9 @@ const std::map<const std::string, const AdhocCommand>& AdhocCommandsHandler::get
void AdhocCommandsHandler::add_command(std::string name, AdhocCommand command)
{
const auto found = this->commands.find(name);
if (found != this->commands.end())
throw std::runtime_error("Trying to add an ad-hoc command that already exist: "s + name);
this->commands.emplace(std::make_pair(std::move(name), std::move(command)));
}