From 6aec9cafa4d302cfb7793ea8da27592ce75b1e49 Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Fri, 11 Jun 2010 13:58:09 +0200 Subject: [PATCH] Lilylib: When formatting the options help, use only one level of indentation We tweaked the IndentedHelpFormatter to not indent the headings at all (even if we have nested groups), so it does not make sense to indent the options themselves, either. Thus, we now have either no indent or exactly indent_increment. --- python/lilylib.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/python/lilylib.py b/python/lilylib.py index e38f69c319..9dc4f3e498 100644 --- a/python/lilylib.py +++ b/python/lilylib.py @@ -238,6 +238,17 @@ class NonDentedHeadingFormatter (optparse.IndentedHelpFormatter): " ".join (option._long_opts), metavar) + # Only use one level of indentation (even for groups and nested groups), + # since we don't indent the headeings, either + def indent(self): + self.current_indent = self.indent_increment + self.level += 1 + def dedent(self): + self.level -= 1 + if self.level <= 0: + self.current_indent = '' + self.level = 0; + def format_usage(self, usage): return _("Usage: %s") % usage + '\n' -- 2.39.5