diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2018-09-18 00:32:18 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2018-09-18 00:32:18 +0200 |
commit | b762ebaa5ef755dc0df7e7bee97cc5bd29b17a5c (patch) | |
tree | 670d8498904bceea6e318b718360f7dfeb22c639 /src | |
parent | f3dfa5685684ac6394d82d7c77c11e85e36df3d2 (diff) |
UpdateTool CLI show total/fail/success updates
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/UpdateTool.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/UpdateTool.cpp b/src/UpdateTool.cpp index 1f4d2af..1f5ccda 100644 --- a/src/UpdateTool.cpp +++ b/src/UpdateTool.cpp @@ -28,6 +28,7 @@ int main(int argc, char* argv[]) /* Command Line Interface (CLI) for UNIX/WIN */ int main(int argc, char *argv[]) { + size_t totalUpdates = 0, successUpdates = 0; int rv; std::vector<UpdateFactory*> uf; std::string errstr, hostPorts; @@ -56,6 +57,10 @@ int main(int argc, char *argv[]) } for (auto *u : uf) { + totalUpdates++; + std::cerr << "Connecting to '" << u->getHostname() << ":" + << u->getPort() << "' with password '" + << u->getPassword() << "'" << std::endl; rv = u->doAuth(); mapEmcError(rv, errstr); if (rv == UPDATE_OK) { @@ -71,6 +76,7 @@ int main(int argc, char *argv[]) std::cerr << "uploading file " << u->getUpdateFile() << std::endl; rv = u->doUpdate(); if (rv == UPDATE_OK) { + successUpdates++; std::cerr << "Update succeeded!" << std::endl; } else { mapEmcError(rv, errstr); @@ -86,6 +92,13 @@ int main(int argc, char *argv[]) for (auto *u : uf) { delete u; } + + std::cout << "-----------------------" << std::endl + << "updates: " << totalUpdates << std::endl + << "success: " << successUpdates << std::endl + << "failed.: " << (totalUpdates - successUpdates) << std::endl + << std::endl; + return 0; } |