From 79e97e20eab241376934b1b211c09d35d0f122ea Mon Sep 17 00:00:00 2001 From: "Vladimir N. Korotenko" Date: Mon, 17 Nov 2025 20:10:03 +0300 Subject: [PATCH] Close #3 change flow --- dm-cli/AccountStatus.cpp | 32 +++++++++++++++++++------------- dm-cli/main.cpp | 4 ++-- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/dm-cli/AccountStatus.cpp b/dm-cli/AccountStatus.cpp index efef8a8..9255756 100644 --- a/dm-cli/AccountStatus.cpp +++ b/dm-cli/AccountStatus.cpp @@ -195,25 +195,31 @@ int AccountFeedbacks(const std::string address, const char* bkaddress, bool isDe if (statustext.compare("positive") == 0) positivefb++; if (statustext.compare("negative") == 0) negativefb++; - if (fb == 1 && statustext.compare("positive") == 0) { + + + if (fb == 0) { stream << "- deal: " << val["deal"] << endl; stream << " date: " << val["date"] << endl; stream << " statustext: " << val["statustext"] << endl; stream << " comments: " << val["comments"] << endl; } - else if (fb == 2 && statustext.compare("negative") == 0) { - stream << "- deal: " << val["deal"] << endl; - stream << " date: " << val["date"] << endl; - stream << " statustext: " << val["statustext"] << endl; - stream << " comments: " << val["comments"] << endl; + else { + if (fb == 1 && statustext.compare("positive") == 0) { + stream << "- deal: " << val["deal"] << endl; + stream << " date: " << val["date"] << endl; + stream << " statustext: " << val["statustext"] << endl; + stream << " comments: " << val["comments"] << endl; + } + else if (fb == 2 && statustext.compare("negative") == 0) { + stream << "- deal: " << val["deal"] << endl; + stream << " date: " << val["date"] << endl; + stream << " statustext: " << val["statustext"] << endl; + stream << " comments: " << val["comments"] << endl; + } } - else - { - stream << "- deal: " << val["deal"] << endl; - stream << " date: " << val["date"] << endl; - stream << " statustext: " << val["statustext"] << endl; - stream << " comments: " << val["comments"] << endl; - } + + + } stream << "------------Summary--------------" << endl; stream << "total: " << size << endl; diff --git a/dm-cli/main.cpp b/dm-cli/main.cpp index df1bac6..6768450 100644 --- a/dm-cli/main.cpp +++ b/dm-cli/main.cpp @@ -90,7 +90,7 @@ int main(int argc, char *argv[]) if (input.cmdOptionExists("-f") || input.cmdOptionExists("--feedbacks")) { int fb = 0; // all - const string &fbp = input.getCmdOption("-f"); + const string fbp = input.getCmdOption("-f"); if (!fbp.empty()) { if (fbp.compare("p") == 0) @@ -98,7 +98,7 @@ int main(int argc, char *argv[]) if (fbp.compare("n") == 0) fb = 2; } - const string &fbps = input.getCmdOption("--feedbacks"); + const string fbps = input.getCmdOption("--feedbacks"); if (!fbps.empty()) { if (fbps.compare("p") == 0)