0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-05 10:08:36 +02:00

modules/console: Command to unload a loaded module; + report on reload.

This commit is contained in:
Jason Volk 2018-03-28 01:23:58 -07:00
parent 09f345c7b9
commit 16154a21df

View file

@ -458,6 +458,7 @@ console_cmd__mod__reload(opt &out, const string_view &line)
}
m::modules.emplace(name, name);
out << "reload " << name << std::endl;
return true;
}
@ -479,6 +480,24 @@ console_cmd__mod__load(opt &out, const string_view &line)
return true;
}
bool
console_cmd__mod__unload(opt &out, const string_view &line)
{
const std::string name
{
token(line, ' ', 0)
};
if(!m::modules.erase(name))
{
out << name << " is not loaded." << std::endl;
return true;
}
out << "unloaded " << name << std::endl;
return true;
}
//
// db
//