summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-06-03 17:55:56 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-06-03 17:55:56 +0000
commitc7b41b673e27be7ed0f5abf4859aacdfba77a6be (patch)
tree68d53a1557c2c8cd66c3490b0747447799329f10 /src
parent7871f1a492bf5139bdda35712741a855b00cb965 (diff)
downloadbcfg2-c7b41b673e27be7ed0f5abf4859aacdfba77a6be.tar.gz
bcfg2-c7b41b673e27be7ed0f5abf4859aacdfba77a6be.tar.bz2
bcfg2-c7b41b673e27be7ed0f5abf4859aacdfba77a6be.zip
Fix post-parse help message (Resolves Ticket #555)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4654 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Options.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/Options.py b/src/lib/Options.py
index 92a71eaf7..aeb70e44c 100644
--- a/src/lib/Options.py
+++ b/src/lib/Options.py
@@ -114,6 +114,10 @@ class Option(object):
self.value = self.default
class OptionSet(dict):
+ def __init__(self, *args):
+ dict.__init__(self, *args)
+ self.hm = self.buildHelpMessage()
+
def buildGetopt(self):
return ''.join([opt.buildGetopt() for opt in self.values()])
@@ -121,6 +125,8 @@ class OptionSet(dict):
return [opt.buildLongGetopt() for opt in self.values() if opt.long]
def buildHelpMessage(self):
+ if hasattr(self, 'hm'):
+ return self.hm
return ''.join([opt.buildHelpMessage() for opt in self.values()])
def helpExit(self, msg='', code=1):