From: Frank Brehm Date: Thu, 20 Apr 2017 09:12:09 +0000 (+0200) Subject: Adding possibility to define a special help text for simulation mode X-Git-Tag: 0.1.2~201 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=fcc8e33e23c2415acaec259e3173a2ce0eeba2ea;p=pixelpark%2Fadmin-tools.git Adding possibility to define a special help text for simulation mode --- diff --git a/pp_lib/app.py b/pp_lib/app.py index 1fe1172..eb1956a 100644 --- a/pp_lib/app.py +++ b/pp_lib/app.py @@ -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(