diff options
-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): |