diff options
Diffstat (limited to 'subcmds/help.py')
| -rw-r--r-- | subcmds/help.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/subcmds/help.py b/subcmds/help.py index fafceadb..c5979fd6 100644 --- a/subcmds/help.py +++ b/subcmds/help.py | |||
| @@ -107,7 +107,7 @@ See 'repo help --all' for a complete list of recognized commands. | |||
| 107 | body = body.strip() | 107 | body = body.strip() |
| 108 | body = body.replace('%prog', me) | 108 | body = body.replace('%prog', me) |
| 109 | 109 | ||
| 110 | asciidoc_hdr = re.compile(r'^\n?([^\n]{1,})\n(={2,}|-{2,})$') | 110 | asciidoc_hdr = re.compile(r'^\n?([^\n]{1,})\n([=~-]{2,})$') |
| 111 | for para in body.split("\n\n"): | 111 | for para in body.split("\n\n"): |
| 112 | if para.startswith(' '): | 112 | if para.startswith(' '): |
| 113 | self.write('%s', para) | 113 | self.write('%s', para) |
| @@ -117,9 +117,19 @@ See 'repo help --all' for a complete list of recognized commands. | |||
| 117 | 117 | ||
| 118 | m = asciidoc_hdr.match(para) | 118 | m = asciidoc_hdr.match(para) |
| 119 | if m: | 119 | if m: |
| 120 | self.heading('%s', m.group(1)) | 120 | title = m.group(1) |
| 121 | type = m.group(2) | ||
| 122 | if type[0] in ('=', '-'): | ||
| 123 | p = self.heading | ||
| 124 | else: | ||
| 125 | def _p(fmt, *args): | ||
| 126 | self.write(' ') | ||
| 127 | self.heading(fmt, *args) | ||
| 128 | p = _p | ||
| 129 | |||
| 130 | p('%s', title) | ||
| 121 | self.nl() | 131 | self.nl() |
| 122 | self.heading('%s', ''.ljust(len(m.group(1)),'-')) | 132 | p('%s', ''.ljust(len(title),type[0])) |
| 123 | self.nl() | 133 | self.nl() |
| 124 | continue | 134 | continue |
| 125 | 135 | ||
