diff options
Diffstat (limited to 'subcmds/help.py')
-rw-r--r-- | subcmds/help.py | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/subcmds/help.py b/subcmds/help.py index 9bb4c8c7..67a225e5 100644 --- a/subcmds/help.py +++ b/subcmds/help.py | |||
@@ -107,15 +107,13 @@ Displays detailed usage information about a command. | |||
107 | 107 | ||
108 | self.heading('%s', heading) | 108 | self.heading('%s', heading) |
109 | self.nl() | 109 | self.nl() |
110 | |||
111 | self.heading('%s', ''.ljust(len(heading), '-')) | ||
112 | self.nl() | 110 | self.nl() |
113 | 111 | ||
114 | me = 'repo %s' % cmd.NAME | 112 | me = 'repo %s' % cmd.NAME |
115 | body = body.strip() | 113 | body = body.strip() |
116 | body = body.replace('%prog', me) | 114 | body = body.replace('%prog', me) |
117 | 115 | ||
118 | asciidoc_hdr = re.compile(r'^\n?([^\n]{1,})\n([=~-]{2,})$') | 116 | asciidoc_hdr = re.compile(r'^\n?#+ (.+)$') |
119 | for para in body.split("\n\n"): | 117 | for para in body.split("\n\n"): |
120 | if para.startswith(' '): | 118 | if para.startswith(' '): |
121 | self.write('%s', para) | 119 | self.write('%s', para) |
@@ -125,19 +123,8 @@ Displays detailed usage information about a command. | |||
125 | 123 | ||
126 | m = asciidoc_hdr.match(para) | 124 | m = asciidoc_hdr.match(para) |
127 | if m: | 125 | if m: |
128 | title = m.group(1) | 126 | self.heading(m.group(1)) |
129 | section_type = m.group(2) | ||
130 | if section_type[0] in ('=', '-'): | ||
131 | p = self.heading | ||
132 | else: | ||
133 | def _p(fmt, *args): | ||
134 | self.write(' ') | ||
135 | self.heading(fmt, *args) | ||
136 | p = _p | ||
137 | |||
138 | p('%s', title) | ||
139 | self.nl() | 127 | self.nl() |
140 | p('%s', ''.ljust(len(title), section_type[0])) | ||
141 | self.nl() | 128 | self.nl() |
142 | continue | 129 | continue |
143 | 130 | ||