mirror of
https://github.com/matrix-construct/construct
synced 2024-10-04 14:48:56 +02:00
modules/console: Command to unload a loaded module; + report on reload.
This commit is contained in:
parent
09f345c7b9
commit
16154a21df
1 changed files with 19 additions and 0 deletions
|
@ -458,6 +458,7 @@ console_cmd__mod__reload(opt &out, const string_view &line)
|
||||||
}
|
}
|
||||||
|
|
||||||
m::modules.emplace(name, name);
|
m::modules.emplace(name, name);
|
||||||
|
out << "reload " << name << std::endl;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -479,6 +480,24 @@ console_cmd__mod__load(opt &out, const string_view &line)
|
||||||
return true;
|
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
|
// db
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue