diff options
Diffstat (limited to 'src/Client/CommandParser.cpp')
-rw-r--r-- | src/Client/CommandParser.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/Client/CommandParser.cpp b/src/Client/CommandParser.cpp index 19aa8a9..be2383a 100644 --- a/src/Client/CommandParser.cpp +++ b/src/Client/CommandParser.cpp @@ -22,10 +22,10 @@ #include "SystemCommands.h" #include "UserCommands.h" -#include <Common/Logger.h> -#include <Common/RequestManager.h> -#include <Common/Tokenizer.h> +#include <Core/Logger.h> +#include <Core/Tokenizer.h> +#include <Common/RequestManager.h> #include <Common/Requests/DisconnectRequest.h> #include <iostream> @@ -71,7 +71,7 @@ void CommandParser::printUsage(const std::string& command) { const CommandParser::Command *cmd = findCommand(command); if(cmd) - Common::Logger::logf("Usage: %s\n", cmd->cmdline); + Core::Logger::logf("Usage: %s\n", cmd->cmdline); } @@ -88,7 +88,7 @@ std::map<std::string, Common::HostInfo> CommandParser::parseHostList(const std:: } if(ret.empty()) - Common::Logger::log("No hosts active."); + Core::Logger::log("No hosts active."); } else { ret = hosts; @@ -98,9 +98,9 @@ std::map<std::string, Common::HostInfo> CommandParser::parseHostList(const std:: std::map<std::string, Common::HostInfo>::const_iterator host = hosts.find(*arg); if(host == hosts.end()) - Common::Logger::logf(Common::Logger::ERROR, "Host '%s' doesn't exist.", arg->c_str()); + Core::Logger::logf(Core::Logger::ERROR, "Host '%s' doesn't exist.", arg->c_str()); else if(mustBeActive && host->second.getState() == Common::HostInfo::INACTIVE) - Common::Logger::logf(Common::Logger::WARNING, "Host '%s' is inactive.", arg->c_str()); + Core::Logger::logf(Core::Logger::WARNING, "Host '%s' is inactive.", arg->c_str()); else ret.insert(*host); } @@ -130,10 +130,10 @@ void CommandParser::helpCommand(const std::vector<std::string> &args, Common::Co std::cout << command->longdesc << std::endl << std::endl; } else - Common::Logger::logf(Common::Logger::WARNING, "%s: Command '%s' doesn't exist.", args[0].c_str(), args[1].c_str()); + Core::Logger::logf(Core::Logger::WARNING, "%s: Command '%s' doesn't exist.", args[0].c_str(), args[1].c_str()); } else { - Common::Logger::logf(Common::Logger::ERROR, "%s: Too many arguments.", args[0].c_str()); + Core::Logger::logf(Core::Logger::ERROR, "%s: Too many arguments.", args[0].c_str()); printUsage("help"); } } @@ -167,7 +167,7 @@ void CommandParser::listHostsCommand(const std::vector<std::string> &args, Commo std::cout << std::endl; } else if(args.size() > 2) { - Common::Logger::logf(Common::Logger::ERROR, "%s: Too many arguments.", args[0].c_str()); + Core::Logger::logf(Core::Logger::ERROR, "%s: Too many arguments.", args[0].c_str()); printUsage("list_hosts"); } else if(args[1] == "-a") { @@ -185,7 +185,7 @@ void CommandParser::listHostsCommand(const std::vector<std::string> &args, Commo std::cout << std::endl; } else { - Common::Logger::logf(Common::Logger::ERROR, "%s: Don't understand argument '%s'.", args[0].c_str(), args[1].c_str()); + Core::Logger::logf(Core::Logger::ERROR, "%s: Don't understand argument '%s'.", args[0].c_str(), args[1].c_str()); printUsage("list_hosts"); } } @@ -196,10 +196,10 @@ void CommandParser::exitCommand(const std::vector<std::string> &args _UNUSED_PAR Common::RequestManager::get()->sendRequest(connection, request); request->wait(); - std::pair<boost::shared_ptr<const Common::XmlPacket>, Net::Exception> result = request->getResult(); + std::pair<boost::shared_ptr<const Common::XmlPacket>, Core::Exception> result = request->getResult(); if(result.second) - Common::Logger::logf(Common::Logger::ERROR, "An error occurred during your request: %s.", result.second.strerror().c_str()); + Core::Logger::logf(Core::Logger::ERROR, "An error occurred during your request: %s.", result.second.strerror().c_str()); else commandParser.disconnect = true; } @@ -207,7 +207,7 @@ void CommandParser::exitCommand(const std::vector<std::string> &args _UNUSED_PAR bool CommandParser::parse(const std::string &cmd) { std::vector<std::string> splitCmd; - Common::Tokenizer::tokenize(cmd, splitCmd); + Core::Tokenizer::tokenize(cmd, splitCmd); if(splitCmd.empty()) return true; @@ -217,7 +217,7 @@ bool CommandParser::parse(const std::string &cmd) { if(command) command->function(splitCmd, connection); else - Common::Logger::logf(Common::Logger::ERROR, "Unknown command '%s'.", splitCmd[0].c_str()); + Core::Logger::logf(Core::Logger::ERROR, "Unknown command '%s'.", splitCmd[0].c_str()); return true; } |