From aa0db7cda81ad2881da827e6f849414a6a994091 Mon Sep 17 00:00:00 2001
From: Riccardo Maria Bianchi <riccardo.maria.bianchi@cern.ch>
Date: Tue, 21 Jun 2022 12:11:28 +0200
Subject: [PATCH] Add '-v' flag to enable verbose output in 'gmcat'

---
 GeoModelTools/GMCAT/src/gmcat.cxx | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/GeoModelTools/GMCAT/src/gmcat.cxx b/GeoModelTools/GMCAT/src/gmcat.cxx
index 9fd267349..b91aba2a0 100644
--- a/GeoModelTools/GMCAT/src/gmcat.cxx
+++ b/GeoModelTools/GMCAT/src/gmcat.cxx
@@ -22,6 +22,8 @@
 #include <string>
 #include <vector>
 #include <unistd.h>
+#include <stdlib.h> // setenv
+
 #ifdef __APPLE__
 const std::string shared_obj_extension=".dylib";
 #else
@@ -64,6 +66,10 @@ int main(int argc, char ** argv) {
           outputFile=argv[argi];
           outputFileSet = true;
       }
+      else if (argument.find("-v")!=std::string::npos) {
+          setenv("GEOMODEL_GEOMODELIO_VERBOSE", "1", 1); // does overwrite
+          std::cout << "You set the verbosity level to 1" << std::endl;
+      }
       else if (argument.find(shared_obj_extension)!=std::string::npos) {
           inputPlugins.push_back(argument);
       }
-- 
GitLab