diff MoinMoin/script/__init__.py @ 5704:bbb286a9c138

script: Added MoinScript._update_option_help(). script.import.wikipage: update the --page option help message.
author Pascal Volk <user@localhost.localdomain.org>
date Sun, 06 Jun 2010 18:48:02 +0000
parents 7cd4adbd6c50
children 7c6029d23a18
line wrap: on
line diff
--- a/MoinMoin/script/__init__.py	Sun Jun 06 18:12:25 2010 +0200
+++ b/MoinMoin/script/__init__.py	Sun Jun 06 18:48:02 2010 +0000
@@ -171,6 +171,13 @@
             help="wiki page name [default: all pages]"
         )
 
+    def _update_option_help(self, opt_string, help_msg):
+        """ Update the help string of an option. """
+        for option in self.parser.option_list:
+            if option.get_opt_string() == opt_string:
+                option.help = help_msg
+                break
+
     def init_request(self):
         """ create request """
         from MoinMoin.web.contexts import ScriptContext