Moved Application::getCommandToHandlerMapping() implementation to Application.cpp
And some other tidying
This commit is contained in:
@@ -3,7 +3,7 @@ A debug interface for embedded systems development on Linux.
|
|||||||
Usage:
|
Usage:
|
||||||
bloom [ENVIRONMENT_NAME/COMMAND]
|
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.
|
If no such environment exists, Bloom will exit.
|
||||||
|
|
||||||
Commands:
|
Commands:
|
||||||
|
|||||||
@@ -85,6 +85,35 @@ namespace Bloom
|
|||||||
return geteuid() == 0;
|
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() {
|
void Application::startup() {
|
||||||
auto& applicationEventListener = this->applicationEventListener;
|
auto& applicationEventListener = this->applicationEventListener;
|
||||||
EventManager::registerListener(applicationEventListener);
|
EventManager::registerListener(applicationEventListener);
|
||||||
|
|||||||
@@ -138,34 +138,7 @@ namespace Bloom
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
auto getCommandToHandlerMapping() {
|
std::map<std::string, std::function<int()>> 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)
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Kicks off the application.
|
* Kicks off the application.
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
|
|
||||||
#include "src/DebugServer/Gdb/ResponsePackets/ErrorResponsePacket.hpp"
|
|
||||||
#include "src/DebugServer/Gdb/ResponsePackets/ResponsePacket.hpp"
|
#include "src/DebugServer/Gdb/ResponsePackets/ResponsePacket.hpp"
|
||||||
|
|
||||||
#include "src/Application.hpp"
|
#include "src/Application.hpp"
|
||||||
@@ -15,7 +14,6 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
|||||||
{
|
{
|
||||||
using TargetController::TargetControllerConsole;
|
using TargetController::TargetControllerConsole;
|
||||||
|
|
||||||
using ResponsePackets::ErrorResponsePacket;
|
|
||||||
using ResponsePackets::ResponsePacket;
|
using ResponsePackets::ResponsePacket;
|
||||||
|
|
||||||
using Exceptions::Exception;
|
using Exceptions::Exception;
|
||||||
|
|||||||
Reference in New Issue
Block a user