diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2008-06-03 17:55:56 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2008-06-03 17:55:56 +0000 |
commit | c7b41b673e27be7ed0f5abf4859aacdfba77a6be (patch) | |
tree | 68d53a1557c2c8cd66c3490b0747447799329f10 /src/lib/Options.py | |
parent | 7871f1a492bf5139bdda35712741a855b00cb965 (diff) | |
download | bcfg2-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/lib/Options.py')
-rw-r--r-- | src/lib/Options.py | 6 |
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): |