From 88624758098d364573fc1fe2a532559caf9302a9 Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Wed, 1 Mar 2023 10:52:28 +0100
Subject: [PATCH] ddsim: allow setting the argument action via EXTRA

Used for Geometry debug flags
---
 DDG4/python/DDSim/Helper/ConfigHelper.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/DDG4/python/DDSim/Helper/ConfigHelper.py b/DDG4/python/DDSim/Helper/ConfigHelper.py
index 21d1d7ade..c092be31a 100644
--- a/DDG4/python/DDSim/Helper/ConfigHelper.py
+++ b/DDG4/python/DDSim/Helper/ConfigHelper.py
@@ -125,7 +125,7 @@ class ConfigHelper(object):
     for name, obj in six.iteritems(vars(ddsim)):
       if isinstance(obj, ConfigHelper):
         for var, optionsDict in six.iteritems(obj.getOptions()):
-          optionsDict['action'] = 'store_true' if var.startswith("enable") else 'store'
+          optionsDict['action'] = 'store_true' if var.startswith("enable") else optionsDict.get('action', 'store')
           parser.add_argument("--%s.%s" % (name, var),
                               dest="%s.%s" % (name, var),
                               **optionsDict
-- 
GitLab