Browse Source

Correct output texts for cmdman

Serdyukov, Denys 4 years ago
parent
commit
56acccb090
3 changed files with 21 additions and 21 deletions
  1. 5 6
      cli/include/cmdman.h
  2. 7 6
      cli/src/batchioman.cpp
  3. 9 9
      cli/src/userioman.cpp

+ 5 - 6
cli/include/cmdman.h

@@ -112,11 +112,11 @@ private:
 	CmdRet cmdHelp(vector<string> args);
 	const string descStatus = "request basic status information from server";
 	CmdRet cmdStatus(vector<string> args);
-	const string descExtendedstatus = "request detailed status information from server with running transfers";
+	const string descExtendedstatus = "request detailed status information from server about running transfers";
 	CmdRet cmdExtendedstatus(vector<string> args);
 	const string descDisconnect = "disconnect from server";
 	CmdRet cmdDisconnect(vector<string> args);
-	const string descPut = "upload file to server and add to queue";
+	const string descPut = "upload file to server";
 	CmdRet cmdPut(vector<string> args);
 	const string descGet = "retrieve file from server";
 	CmdRet cmdGet(vector<string> args);
@@ -124,11 +124,11 @@ private:
 	CmdRet cmdList(vector<string> args);
 	const string descExtendedlist = "list files available on server with further information";
 	CmdRet cmdExtendedlist(vector<string> args);
-	const string descHead = "request the first four bytes of a file from the server";
+	const string descHead = "request the first few bytes of a file from the server";
 	CmdRet cmdHead(vector<string> args);
 	const string descDeletefile = "delete a file from the server";
 	CmdRet cmdDeletefile(vector<string> args);
-	const string descKeyfile = "set keyfile to use";
+	const string descKeyfile = "set keyfile to use for encryption";
 	CmdRet cmdKeyfile(vector<string> args);
 	const string descClosekey = "stop using the previously selected keyfile";
 	CmdRet cmdClosekey(vector<string> args);
@@ -143,8 +143,7 @@ private:
 	CmdRet cmdLogin(vector<string> args);
 	const string descSignup = "sign up and login to the server";
 	CmdRet cmdSignup(vector<string> args);
-	const string descDeleteme = "delete the user you are currently logged in as "
-	                            "(needs to be confirmed with the password)";
+	const string descDeleteme = "delete the user you are currently logged in as (needs to be confirmed with the password)";
 	CmdRet cmdDeleteme(vector<string> args);
 	const string descQueue = "add a file that is already on the server to the queue for sending with the covert channel";
 	CmdRet cmdQueue(vector<string> args);

+ 7 - 6
cli/src/batchioman.cpp

@@ -288,7 +288,7 @@ std::string BatchIoMan::printJson(Json::Value root) {
 	map<string, std::string (BatchIoMan::*)(Json::Value)>::iterator it = printmap.find(root["command"].asString());
 	if (it == printmap.end()) {
 		// this should never happen outside of development
-		printMessage(string(__PRETTY_FUNCTION__) + " unknown command \"" + root["command"].asString() + "\".\nensure code is implemented.", debug);
+		printMessage(string(__PRETTY_FUNCTION__) + " unknown command \"" + root["command"].asString() + "\".\nEnsure code is implemented.", debug);
 		return "";
 	}
 	return (this->*(printmap[root["command"].asString()]))(root);
@@ -464,7 +464,8 @@ std::string BatchIoMan::printExtendedlist(Json::Value root) {
 
 std::string BatchIoMan::printVersion(Json::Value root) {
 	if (!root["accept"].asBool()) {
-		return std::string("Version check failed. Server reports ") + root["serverversion"].asString() + " but client is " + root["clientversion"].asString();
+		return std::string("Version check failed. Server reports version ") + root["serverversion"].asString() + " but client is " +
+		       root["clientversion"].asString();
 	} else
 		return "Version check ok.";
 }
@@ -498,9 +499,9 @@ std::string BatchIoMan::printListdata(Json::Value root) { return ""; }
 
 std::string BatchIoMan::printHead(Json::Value root) {
 	if (!root["accept"].asBool())
-		return std::string("Request of the first four bytes failed. ") + root["error"].asString();
+		return std::string("Request of the first few bytes failed. ") + root["error"].asString();
 	else
-		return std::string("First four bytes of file ") + root["file"].asString() + " are: " + root["data"].asString();
+		return std::string("First few bytes of file ") + root["file"].asString() + " are: " + root["data"].asString();
 }
 
 std::string BatchIoMan::printDeletefile(Json::Value root) {
@@ -528,14 +529,14 @@ std::string BatchIoMan::printQueue(Json::Value root) {
 	if (!root["accept"].asBool())
 		return std::string("Queueing of file ") + root["file"].asString() + " failed. " + root["error"].asString();
 	else
-		return std::string("File ") + root["file"].asString() + " queued succesfully";
+		return std::string("File ") + root["file"].asString() + " queued succesfully.";
 }
 
 std::string BatchIoMan::printDequeue(Json::Value root) {
 	if (!root["accept"].asBool())
 		return std::string("Dequeueing of file ") + root["file"].asString() + " failed. " + root["error"].asString();
 	else
-		return std::string("File ") + root["file"].asString() + " dequeued succesfully";
+		return std::string("File ") + root["file"].asString() + " dequeued succesfully.";
 }
 
 std::string BatchIoMan::printNotifications(Json::Value root) {

+ 9 - 9
cli/src/userioman.cpp

@@ -78,7 +78,7 @@ void UserIoMan::printMessage(std::string msg, OutMsgType type) {
 
 void UserIoMan::printWelcomeMessage() {
 	std::cout << std::endl
-	          << "Please connect to a server via \"connect <ip> <port>\"," << std::endl
+	          << "Please connect to a server via \"connect <ip> <port>\", then" << std::endl
 	          << "login by entering \"login <username> <password>\"" << std::endl
 	          << "or sign up and log in with \"signup <username> <password>\"." << std::endl
 	          << std::endl;
@@ -90,7 +90,7 @@ void UserIoMan::printJson(Json::Value root) {
 	map<string, void (UserIoMan::*)(Json::Value)>::iterator it = printmap.find(root["command"].asString());
 	if (it == printmap.end()) {
 		// this should never happen outside of development
-		printMessage(string(__PRETTY_FUNCTION__) + " unknown command \"" + root["command"].asString() + "\".\nensure code is implemented.", debug);
+		printMessage(string(__PRETTY_FUNCTION__) + " unknown command \"" + root["command"].asString() + "\".\nEnsure code is implemented.", debug);
 		return;
 	}
 	(this->*(printmap[root["command"].asString()]))(root);
@@ -238,7 +238,7 @@ void UserIoMan::printExtendedlist(Json::Value root) {
 				} else if (encrypted == "undecryptable") {
 					decryptable = "\033[31mno\033[0m           "; // "no" in red
 				} else if (encrypted == "unknown") {
-					decryptable = "unknown      "; // "no" in red
+					decryptable = "unknown      ";
 				} else {
 					decryptable = "plaintext    ";
 				}
@@ -258,8 +258,8 @@ void UserIoMan::printExtendedlist(Json::Value root) {
 
 void UserIoMan::printVersion(Json::Value root) {
 	if (!root["accept"].asBool()) {
-		std::cout << "Version check failed. Server reports " << root["serverversion"].asString() << " but client is " << root["clientversion"].asString()
-		          << std::endl;
+		std::cout << "Version check failed. Server reports version " << root["serverversion"].asString() << " but client is "
+		          << root["clientversion"].asString() << std::endl;
 	} else
 		std::cout << "Version check ok." << std::endl;
 }
@@ -293,9 +293,9 @@ void UserIoMan::printListdata(Json::Value root) {}
 
 void UserIoMan::printHead(Json::Value root) {
 	if (!root["accept"].asBool())
-		std::cout << "Request of the first four bytes failed. " << root["error"].asString() << std::endl;
+		std::cout << "Request of the first few bytes failed. " << root["error"].asString() << std::endl;
 	else
-		std::cout << "First four bytes of file " << root["file"].asString() << " are: " << root["data"].asString() << std::endl;
+		std::cout << "First few bytes of file " << root["file"].asString() << " are: " << root["data"].asString() << std::endl;
 }
 
 void UserIoMan::printDeletefile(Json::Value root) {
@@ -323,14 +323,14 @@ void UserIoMan::printQueue(Json::Value root) {
 	if (!root["accept"].asBool())
 		std::cout << "Queueing of file " << root["file"] << " failed. " << root["error"].asString() << std::endl;
 	else
-		std::cout << "File " << root["file"] << " queued succesfully" << std::endl;
+		std::cout << "File " << root["file"] << " queued succesfully." << std::endl;
 }
 
 void UserIoMan::printDequeue(Json::Value root) {
 	if (!root["accept"].asBool())
 		std::cout << "Dequeueing of file " << root["file"] << " failed. " << root["error"].asString() << std::endl;
 	else
-		std::cout << "File " << root["file"] << " dequeued succesfully" << std::endl;
+		std::cout << "File " << root["file"] << " dequeued succesfully." << std::endl;
 }
 
 void UserIoMan::printNotifications(Json::Value root) {