diff options
author | Julien Jehannet <julien.jehannet@logilab.fr> | 2010-06-04 19:08:44 +0200 |
---|---|---|
committer | Julien Jehannet <julien.jehannet@logilab.fr> | 2010-06-04 19:08:44 +0200 |
commit | 334418282f420740660cfec646ffa57035d67af7 (patch) | |
tree | f3a42f885da77d8b681557e0eda96940e5bc054b /optik_ext.py | |
parent | 6f86a782546f095bb513a40630e653f37680030d (diff) | |
download | logilab-common-334418282f420740660cfec646ffa57035d67af7.tar.gz |
add COPYRIGHT section in man page only if copyright was filled
Diffstat (limited to 'optik_ext.py')
-rw-r--r-- | optik_ext.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/optik_ext.py b/optik_ext.py index ba2c3a5..44d0504 100644 --- a/optik_ext.py +++ b/optik_ext.py @@ -353,21 +353,25 @@ class ManHelpFormatter(HelpFormatter): ''' % (pgm, long_desc.strip()) def format_tail(self, pkginfo): - return '''.SH SEE ALSO + tail = '''.SH SEE ALSO /usr/share/doc/pythonX.Y-%s/ -.SH COPYRIGHT -%s - .SH BUGS Please report bugs on the project\'s mailing list: %s .SH AUTHOR %s <%s> -''' % (getattr(pkginfo, 'debian_name', pkginfo.modname), pkginfo.copyright, +''' % (getattr(pkginfo, 'debian_name', pkginfo.modname), pkginfo.mailinglist, pkginfo.author, pkginfo.author_email) + if hasattr(pkginfo, "copyright"): + tail += ''' +.SH COPYRIGHT +%s +''' % pkginfo.copyright + + return tail def generate_manpage(optparser, pkginfo, section=1, stream=sys.stdout, level=0): """generate a man page from an optik parser""" |