summaryrefslogtreecommitdiffstats
path: root/src/Client
diff options
context:
space:
mode:
Diffstat (limited to 'src/Client')
-rw-r--r--src/Client/CommandParser.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Client/CommandParser.cpp b/src/Client/CommandParser.cpp
index 9b5c009..b9368b5 100644
--- a/src/Client/CommandParser.cpp
+++ b/src/Client/CommandParser.cpp
@@ -55,7 +55,7 @@ void CommandParser::printUsage(const std::string& command) {
const CommandParser::Command *cmd = findCommand(command);
if(cmd)
- std::cerr << "Usage: " << cmd->cmdline << std::endl;
+ std::cerr << "Usage: " << cmd->cmdline << std::endl << std::endl;
}
void CommandParser::printHostStatus(const Net::Packets::HostStatusPacket &packet) {
@@ -129,10 +129,10 @@ void CommandParser::helpCommand(const std::vector<std::string> &args) {
if(command) {
std::cout << "Usage: " << command->cmdline << std::endl << std::endl;
- std::cout << command->longdesc << std::endl;
+ std::cout << command->longdesc << std::endl << std::endl;
}
else
- std::cerr << args[0] << ": Command '" << args[1] << "' doesn't exist." << std::endl;
+ std::cerr << args[0] << ": Command '" << args[1] << "' doesn't exist." << std::endl << std::endl;
}
else {
std::cerr << args[0] << ": Too many arguments." << std::endl;
@@ -151,8 +151,11 @@ void CommandParser::statusCommand(const std::vector<std::string> &args) {
Requests::CoreStatusRequest::send(connection, sigc::mem_fun(this, &CommandParser::coreStatusRequestFinished));
else if(args.size() == 2)
Requests::DaemonStatusRequest::send(connection, sigc::mem_fun(this, &CommandParser::daemonStatusRequestFinished), args[1]);
- else
+ else {
+ std::cerr << args[0] << ": Too many arguments." << std::endl;
+ printUsage("status");
return;
+ }
activeRequests++;
}
@@ -268,7 +271,7 @@ bool CommandParser::parse(const std::string &cmd) {
if(command)
(this->*command->funcPtr)(splitCmd);
else
- std::cerr << "Unknown command '" << splitCmd[0] << "'." << std::endl;
+ std::cerr << "Unknown command '" << splitCmd[0] << "'." << std::endl << std::endl;
return true;
}