summaryrefslogtreecommitdiff
path: root/optik_ext.py
diff options
context:
space:
mode:
authorSylvain Thenault <sylvain.thenault@logilab.fr>2008-09-19 10:31:12 +0200
committerSylvain Thenault <sylvain.thenault@logilab.fr>2008-09-19 10:31:12 +0200
commit11992e6dd0bf706410aa1fe23cf15f51e19007dd (patch)
tree4f738c04919142c6e18a987191d3ba4e848af29e /optik_ext.py
parent3009a302c3579f63ffa3c11afec7f040852485ef (diff)
downloadlogilab-common-11992e6dd0bf706410aa1fe23cf15f51e19007dd.tar.gz
fix man page generation as well, drop no more necessary function
Diffstat (limited to 'optik_ext.py')
-rw-r--r--optik_ext.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/optik_ext.py b/optik_ext.py
index 63b0a1c..123a2a6 100644
--- a/optik_ext.py
+++ b/optik_ext.py
@@ -230,7 +230,8 @@ class ManHelpFormatter(HelpFormatter):
except AttributeError:
optstring = self.format_option_strings(option)
if option.help:
- help = ' '.join([l.strip() for l in option.help.splitlines()])
+ help_text = self.expand_default(option)
+ help = ' '.join([l.strip() for l in help_text.splitlines()])
else:
help = ''
return '''.IP "%s"
@@ -313,6 +314,7 @@ Please report bugs on the project\'s mailing list:
def generate_manpage(optparser, pkginfo, section=1, stream=sys.stdout):
"""generate a man page from an optik parser"""
formatter = ManHelpFormatter()
+ formatter.parser = optparser
print >> stream, formatter.format_head(optparser, pkginfo, section)
print >> stream, optparser.format_option_help(formatter)
print >> stream, formatter.format_tail(pkginfo)