From 7a56f3c1c593431807753b8222d7bee487b9d464 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Wed, 15 Oct 2014 16:43:10 +0200 Subject: [PATCH] CLI: Add --count to 'object list' and hide counts by default refs #7251 --- lib/cli/objectlistcommand.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/cli/objectlistcommand.cpp b/lib/cli/objectlistcommand.cpp index 7418d8301..3240a8cac 100644 --- a/lib/cli/objectlistcommand.cpp +++ b/lib/cli/objectlistcommand.cpp @@ -57,6 +57,7 @@ void ObjectListCommand::InitParameters(boost::program_options::options_descripti ArgumentCompletionDescription& argCompletionDesc) const { visibleDesc.add_options() + ("count,c", "display object counts by types") ("name,n", po::value(), "filter by name matches") ("type,t", po::value(), "filter by type matches"); } @@ -103,9 +104,10 @@ int ObjectListCommand::Run(const boost::program_options::variables_map& vm, cons sfp->Close(); fp.close(); - std::cout << FormatTypeCounts(type_count) << std::endl; + if (vm.count("count")) + std::cout << FormatTypeCounts(type_count) << std::endl; - Log(LogInformation, "cli", "Parsed " + Convert::ToString(objects_count) + " objects."); + Log(LogNotice, "cli", "Parsed " + Convert::ToString(objects_count) + " objects."); return 0; } @@ -133,7 +135,7 @@ void ObjectListCommand::ReadObject(const String& message, std::map& else msgbuf << "Object '"; - msgbuf << "\x1b[1;37m" << properties->Get("__name") << "\x1b[0m" << "'"; //light gray + msgbuf << "\x1b[1;34m" << properties->Get("__name") << "\x1b[0m" << "'"; //blue msgbuf << " of type '" << "\x1b[1;34m" << type << "\x1b[0m" << "':\n"; //blue msgbuf << FormatProperties(properties, debug_hints, 2); -- 2.40.0