diff --git a/resources/help.txt b/resources/help.txt index d114bc33..5d347c9f 100644 --- a/resources/help.txt +++ b/resources/help.txt @@ -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: diff --git a/src/Application.cpp b/src/Application.cpp index 673920c7..c830fe6b 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -85,6 +85,35 @@ namespace Bloom return geteuid() == 0; } + std::map> Application::getCommandToHandlerMapping() { + return std::map> { + { + "--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); diff --git a/src/Application.hpp b/src/Application.hpp index 846c25ef..9aca8682 100644 --- a/src/Application.hpp +++ b/src/Application.hpp @@ -138,34 +138,7 @@ namespace Bloom * * @return */ - auto getCommandToHandlerMapping() { - return std::map> { - { - "--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> getCommandToHandlerMapping(); /** * Kicks off the application. diff --git a/src/DebugServer/Gdb/CommandPackets/BloomVersionMachine.cpp b/src/DebugServer/Gdb/CommandPackets/BloomVersionMachine.cpp index e5b24187..163d32fb 100644 --- a/src/DebugServer/Gdb/CommandPackets/BloomVersionMachine.cpp +++ b/src/DebugServer/Gdb/CommandPackets/BloomVersionMachine.cpp @@ -4,7 +4,6 @@ #include #include -#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;