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

@@ -3,7 +3,7 @@ A debug interface for embedded systems development on Linux.
Usage:
bloom [ENVIRONMENT_NAME/COMMAND]
If no environment name or command is provided, Bloom will fallback to the environment named "default".
If no environment name or command is provided, Bloom will fall back to the environment named "default".
If no such environment exists, Bloom will exit.
Commands:

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);

View File

@@ -138,34 +138,7 @@ namespace Bloom
*
* @return
*/
auto 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)
},
};
}
std::map<std::string, std::function<int()>> getCommandToHandlerMapping();
/**
* Kicks off the application.

View File

@@ -4,7 +4,6 @@
#include <QJsonDocument>
#include <QJsonObject>
#include "src/DebugServer/Gdb/ResponsePackets/ErrorResponsePacket.hpp"
#include "src/DebugServer/Gdb/ResponsePackets/ResponsePacket.hpp"
#include "src/Application.hpp"
@@ -15,7 +14,6 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
{
using TargetController::TargetControllerConsole;
using ResponsePackets::ErrorResponsePacket;
using ResponsePackets::ResponsePacket;
using Exceptions::Exception;