]> git.donarmstrong.com Git - lilypond.git/commitdiff
Lilylib: When formatting the options help, use only one level of indentation
authorReinhold Kainhofer <reinhold@kainhofer.com>
Fri, 11 Jun 2010 11:58:09 +0000 (13:58 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Fri, 11 Jun 2010 12:07:02 +0000 (14:07 +0200)
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

index e38f69c3192013a929feee53c641e33a26fcd046..9dc4f3e498e72f75d007d2858c6450f9c6950d10 100644 (file)
@@ -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'