Moved Application::getCommandToHandlerMapping() implementation to Application.cpp

And some other tidying
This commit is contained in:
Nav
2022-05-06 19:34:12 +01:00
parent a60f780287
commit b19110ff62
4 changed files with 31 additions and 31 deletions

View File

@@ -85,6 +85,35 @@ namespace Bloom
return geteuid() == 0;
}
std::map<std::string, std::function<int()>> Application::getCommandToHandlerMapping() {
return std::map<std::string, std::function<int()>> {
{
"--help",
std::bind(&Application::presentHelpText, this)
},
{
"-h",
std::bind(&Application::presentHelpText, this)
},
{
"--version",
std::bind(&Application::presentVersionText, this)
},
{
"-v",
std::bind(&Application::presentVersionText, this)
},
{
"--version-machine",
std::bind(&Application::presentVersionMachineText, this)
},
{
"init",
std::bind(&Application::initProject, this)
},
};
}
void Application::startup() {
auto& applicationEventListener = this->applicationEventListener;
EventManager::registerListener(applicationEventListener);