From 85920389b2a954708cd6ab6dee2071685b00da8b Mon Sep 17 00:00:00 2001
From: Michael Davis <michael.davis@cern.ch>
Date: Tue, 18 Jun 2019 13:43:22 +0200
Subject: [PATCH] [cta-admin] Displays boolean output correctly as true/false

---
 cmdline/CtaAdminTextFormatter.hpp | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/cmdline/CtaAdminTextFormatter.hpp b/cmdline/CtaAdminTextFormatter.hpp
index d7388fa34c..58284cf42c 100644
--- a/cmdline/CtaAdminTextFormatter.hpp
+++ b/cmdline/CtaAdminTextFormatter.hpp
@@ -86,20 +86,30 @@ private:
     buildVector(line, args...);
   }
 
-  //! Base case method to add one item to the log, with specialisations by type
-  template<typename T>
-  void buildVector(std::vector<std::string> &line, const T &item) {
-    line.push_back(std::to_string(item));
-  }
-
+  //! Base case method to add one item to the log
   void buildVector(std::vector<std::string> &line, const std::string &item) {
     line.push_back(item);
   }
 
+  //! Base case method to add one item to the log, overloaded for char*
   void buildVector(std::vector<std::string> &line, const char *item) {
     line.push_back(std::string(item));
   }
 
+  //! Base case method to add one item to the log, overloaded for bool
+  void buildVector(std::vector<std::string> &line, bool item) {
+    line.push_back(item ? "true" : "false");
+  }
+
+  /*!
+   * Base case method to add one item to the log, with partial specialisation
+   * (works for all integer and floating-point types)
+   */
+  template<typename T>
+  void buildVector(std::vector<std::string> &line, const T &item) {
+    line.push_back(std::to_string(item));
+  }
+
   //! Flush buffer to stdout
   void flush();
 
-- 
GitLab