From 36800db06495c133584f6f5681a4ca87e96e2bc2 Mon Sep 17 00:00:00 2001 From: Nav Date: Sat, 28 May 2022 23:11:00 +0100 Subject: [PATCH] Tidying --- src/Application.cpp | 8 ++++---- src/Application.hpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Application.cpp b/src/Application.cpp index 78d19554..23e511b6 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -21,11 +21,11 @@ namespace Bloom if (!arguments.empty()) { auto& firstArg = arguments.front(); - const auto commandsToCallbackMapping = this->getCommandToHandlerMapping(); + const auto commandHandlersByCommandName = this->getCommandHandlersByCommandName(); - if (commandsToCallbackMapping.contains(firstArg)) { + if (commandHandlersByCommandName.contains(firstArg)) { // User has passed an argument that maps to a command callback - invoke the callback and shutdown - auto returnValue = commandsToCallbackMapping.at(firstArg)(); + const auto returnValue = commandHandlersByCommandName.at(firstArg)(); this->shutdown(); return returnValue; @@ -85,7 +85,7 @@ namespace Bloom return geteuid() == 0; } - std::map> Application::getCommandToHandlerMapping() { + std::map> Application::getCommandHandlersByCommandName() { return std::map> { { "--help", diff --git a/src/Application.hpp b/src/Application.hpp index 9aca8682..5deab95a 100644 --- a/src/Application.hpp +++ b/src/Application.hpp @@ -131,14 +131,14 @@ namespace Bloom /** * Some CLI arguments are interpreted as commands and thus require specific handler methods to be called. - * This mapping maps command strings to the appropriate handler methods. The mapped handler method is invoked - * when the command is provided as an argument from the CLI. + * This mapping maps command names to the appropriate handler methods. The mapped handler method is invoked + * when the command name is provided as an argument from the CLI. * * See Application::run() for more on this. * * @return */ - std::map> getCommandToHandlerMapping(); + std::map> getCommandHandlersByCommandName(); /** * Kicks off the application.