Procházet zdrojové kódy

improved output formatting in userioman/batchioman

Denys před 4 roky
rodič
revize
8f3247f136
2 změnil soubory, kde provedl 16 přidání a 16 odebrání
  1. 8 8
      cli/src/batchioman.cpp
  2. 8 8
      cli/src/userioman.cpp

+ 8 - 8
cli/src/batchioman.cpp

@@ -299,7 +299,7 @@ std::string BatchIoMan::printError(Json::Value root) { return std::string("Error
 
 std::string BatchIoMan::printConnect(Json::Value root) {
 	if (!root["accept"].asBool()) {
-		return std::string("Couldnt connect to ") + root["address"].asString() + ":" + std::to_string(root["port"].asUInt()) + "\n" +
+		return std::string("Couldnt connect to ") + root["address"].asString() + ":" + std::to_string(root["port"].asUInt()) + ".\n" +
 		       "Reason: " + root["error"].asString();
 	}
 	return "";
@@ -393,7 +393,7 @@ std::string BatchIoMan::printPut(Json::Value root) {
 			return std::string("Upload request failed: ") + root["error"].asString();
 		}
 	} else
-		return std::string("Begin uploading file ") + root["file"].asString();
+		return std::string("Begin uploading file ") + root["file"].asString() + ".";
 }
 
 std::string BatchIoMan::printGet(Json::Value root) {
@@ -466,7 +466,7 @@ 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 version ") + root["serverversion"].asString() + " but client is " +
-		       root["clientversion"].asString();
+		       root["clientversion"].asString() + ".";
 	} else
 		return "Version check ok.";
 }
@@ -507,16 +507,16 @@ std::string BatchIoMan::printHead(Json::Value root) {
 
 std::string BatchIoMan::printDeletefile(Json::Value root) {
 	if (!root["accept"].asBool())
-		return std::string("Deletion of file ") + root["file"].asString() + " failed. " + root["error"].asString();
+		return std::string("Deletion of file ") + root["file"].asString() + " failed: " + root["error"].asString();
 	else
-		return std::string("File ") + root["file"].asString() + " deleted succesfully";
+		return std::string("File ") + root["file"].asString() + " deleted succesfully.";
 }
 
 std::string BatchIoMan::printKeyfile(Json::Value root) {
 	if (!root["accept"].asBool())
 		return std::string("Couldnt select keyfile ") + root["file"].asString() + ": " + root["error"].asString();
 	else
-		return std::string("Using keyfile ") + root["file"].asString();
+		return std::string("Using keyfile ") + root["file"].asString() + ".";
 }
 
 std::string BatchIoMan::printClosekey(Json::Value root) {
@@ -528,14 +528,14 @@ std::string BatchIoMan::printClosekey(Json::Value root) {
 
 std::string BatchIoMan::printQueue(Json::Value root) {
 	if (!root["accept"].asBool())
-		return std::string("Queueing of file ") + root["file"].asString() + " failed. " + root["error"].asString();
+		return std::string("Queueing of file ") + root["file"].asString() + " failed: " + root["error"].asString();
 	else
 		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();
+		return std::string("Dequeueing of file ") + root["file"].asString() + " failed: " + root["error"].asString();
 	else
 		return std::string("File ") + root["file"].asString() + " dequeued succesfully.";
 }

+ 8 - 8
cli/src/userioman.cpp

@@ -120,7 +120,7 @@ void UserIoMan::printError(Json::Value root) { std::cout << "Error: " << root["e
 
 void UserIoMan::printConnect(Json::Value root) {
 	if (!root["accept"].asBool()) {
-		std::cout << "Couldnt connect to " << root["address"].asString() << ":" << root["port"].asUInt() << std::endl
+		std::cout << "Couldnt connect to " << root["address"].asString() << ":" << root["port"].asUInt() << "." << std::endl
 		          << "Reason: " << root["error"].asString() << std::endl;
 	}
 }
@@ -221,7 +221,7 @@ void UserIoMan::printGet(Json::Value root) {
 			std::cout << "Download request failed: " << root["error"].asString() << std::endl;
 		}
 	} else
-		std::cout << "Begin downloading file " << root["file"].asString() << std::endl;
+		std::cout << "Begin downloading file " << root["file"].asString() << "." << std::endl;
 }
 
 void UserIoMan::printList(Json::Value root) {
@@ -279,7 +279,7 @@ void UserIoMan::printExtendedlist(Json::Value root) {
 void UserIoMan::printVersion(Json::Value root) {
 	if (!root["accept"].asBool()) {
 		std::cout << "Version check failed. Server reports version " << root["serverversion"].asString() << " but client is "
-		          << root["clientversion"].asString() << std::endl;
+		          << root["clientversion"].asString() << "." << std::endl;
 	} else
 		std::cout << "Version check ok." << std::endl;
 }
@@ -320,16 +320,16 @@ void UserIoMan::printHead(Json::Value root) {
 
 void UserIoMan::printDeletefile(Json::Value root) {
 	if (!root["accept"].asBool())
-		std::cout << "Deletion of file " << root["file"] << " failed. " << root["error"].asString() << std::endl;
+		std::cout << "Deletion of file " << root["file"] << " failed: " << root["error"].asString() << std::endl;
 	else
-		std::cout << "File " << root["file"] << " deleted succesfully" << std::endl;
+		std::cout << "File " << root["file"] << " deleted succesfully." << std::endl;
 }
 
 void UserIoMan::printKeyfile(Json::Value root) {
 	if (!root["accept"].asBool())
 		std::cout << "Couldnt select keyfile " << root["file"].asString() << ": " << root["error"].asString() << std::endl;
 	else
-		std::cout << "Using keyfile " << root["file"].asString() << std::endl;
+		std::cout << "Using keyfile " << root["file"].asString() << "." << std::endl;
 }
 
 void UserIoMan::printClosekey(Json::Value root) {
@@ -341,14 +341,14 @@ void UserIoMan::printClosekey(Json::Value root) {
 
 void UserIoMan::printQueue(Json::Value root) {
 	if (!root["accept"].asBool())
-		std::cout << "Queueing of file " << root["file"] << " failed. " << root["error"].asString() << std::endl;
+		std::cout << "Queueing of file " << root["file"] << " failed: " << root["error"].asString() << std::endl;
 	else
 		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;
+		std::cout << "Dequeueing of file " << root["file"] << " failed: " << root["error"].asString() << std::endl;
 	else
 		std::cout << "File " << root["file"] << " dequeued succesfully." << std::endl;
 }