From 52e4c3086c12b460541e53d74e54abf6d6b3fe65 Mon Sep 17 00:00:00 2001 From: Jan Pokorný Date: Mon, 1 Feb 2016 19:05:26 +0100 Subject: main: better support for short/long "report bugs" link MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan Pokorný --- main.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 1ecc2b6..3f9e483 100644 --- a/main.py +++ b/main.py @@ -31,7 +31,10 @@ try: except ImportError: report_bugs = () else: - report_bugs = ("Report bugs to <{0}>.".format(REPORT_BUGS), ) + report_bugs = ("Report bugs to", "<{0}>".format(REPORT_BUGS)) + joint = ' '.join(report_bugs) + '.' + if len(joint) < 70: + report_bugs = (joint, ) _system = system().lower() @@ -234,8 +237,10 @@ class SharedOptionParser(OptionParser): + (self.description_raw and '\n' + self.description_raw + '\n') def format_epilog(self, formatter): - return ''.join(formatter.format_epilog(l) - for l in self.epilog.split('\n')) + ret = '\n' + '\n'.join(formatter.format_epilog(l).strip('\n') + if '