From e07aad44a0e483ec302b41233de4b79dfbab7d1d Mon Sep 17 00:00:00 2001 From: Matej Ferencevic <matej.ferencevic@memgraph.io> Date: Mon, 4 Mar 2019 14:46:02 +0100 Subject: [PATCH] Improve manual bolt client Summary: Add flag to disable printing of records. Reviewers: teon.banek Reviewed By: teon.banek Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D1898 --- tests/manual/bolt_client.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/manual/bolt_client.cpp b/tests/manual/bolt_client.cpp index f8597a679..496695ab5 100644 --- a/tests/manual/bolt_client.cpp +++ b/tests/manual/bolt_client.cpp @@ -11,6 +11,8 @@ DEFINE_int32(port, 7687, "Server port"); DEFINE_string(username, "", "Username for the database"); DEFINE_string(password, "", "Password for the database"); DEFINE_bool(use_ssl, false, "Set to true to connect with SSL to the server."); +DEFINE_bool(print_records, true, + "Set to false to disable printing of records."); int main(int argc, char **argv) { gflags::ParseCommandLineFlags(&argc, &argv, true); @@ -46,11 +48,13 @@ int main(int argc, char **argv) { std::cout << " " << field << std::endl; } - std::cout << "Records:" << std::endl; - for (int i = 0; i < static_cast<int>(ret.records.size()); ++i) { - std::cout << " " << i << std::endl; - for (auto &value : ret.records[i]) { - std::cout << " " << value << std::endl; + if (FLAGS_print_records) { + std::cout << "Records:" << std::endl; + for (int i = 0; i < static_cast<int>(ret.records.size()); ++i) { + std::cout << " " << i << std::endl; + for (auto &value : ret.records[i]) { + std::cout << " " << value << std::endl; + } } }