]> Frank Brehm's Git Trees - pixelpark/admin-tools.git/commitdiff
Adding possibility to define a special help text for simulation mode
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 20 Apr 2017 09:12:09 +0000 (11:12 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 20 Apr 2017 09:12:09 +0000 (11:12 +0200)
pp_lib/app.py

index 1fe1172c6956ec1375ab3ea0e2f6426df3aa60f2..eb1956a4d6d7313396ef78f32921f9ff2b11e51f 100644 (file)
@@ -34,7 +34,7 @@ from .colored import ColoredFormatter, colorstr
 
 from .obj import PpBaseObjectError, PpBaseObject
 
-__version__ = '0.3.3'
+__version__ = '0.3.4'
 LOG = logging.getLogger(__name__)
 
 
@@ -574,10 +574,12 @@ class PpApplication(PpBaseObject):
             )
 
         if self.show_simulate_opt:
+            help_msg = getattr(self, '_simulate_opt_help', None)
+            if not help_msg or str(help_msg) == '':
+                help_msg = "Simulation af all actions, nothing is really done."
             general_group.add_argument(
                 "-s", "--simulate",
-                action="store_true", dest="simulate",
-                help="Simulation af all actions, nothing is really done.",
+                action="store_true", dest="simulate", help=help_msg,
             )
 
         general_group.add_argument(