##// END OF EJS Templates
gendoc: indent loop to make next patch more legible...
Sietse Brouwer -
r42434:0786b791 default
parent child Browse files
Show More
@@ -185,44 +185,45 b' def commandprinter(ui, cmdtable, section'
185 h[f] = c
185 h[f] = c
186 cmds = h.keys()
186 cmds = h.keys()
187
187
188 for f in sorted(cmds):
188 if True:
189 if f.startswith(b"debug"):
189 for f in sorted(cmds):
190 continue
190 if f.startswith(b"debug"):
191 d = get_cmd(h[f], cmdtable)
191 continue
192 ui.write(sectionfunc(d[b'cmd']))
192 d = get_cmd(h[f], cmdtable)
193 # short description
193 ui.write(sectionfunc(d[b'cmd']))
194 ui.write(d[b'desc'][0])
194 # short description
195 # synopsis
195 ui.write(d[b'desc'][0])
196 ui.write(b"::\n\n")
197 synopsislines = d[b'synopsis'].splitlines()
198 for line in synopsislines:
199 # some commands (such as rebase) have a multi-line
200 # synopsis
196 # synopsis
201 ui.write(b" %s\n" % line)
197 ui.write(b"::\n\n")
202 ui.write(b'\n')
198 synopsislines = d[b'synopsis'].splitlines()
203 # description
199 for line in synopsislines:
204 ui.write(b"%s\n\n" % d[b'desc'][1])
200 # some commands (such as rebase) have a multi-line
205 # options
201 # synopsis
206 opt_output = list(d[b'opts'])
202 ui.write(b" %s\n" % line)
207 if opt_output:
203 ui.write(b'\n')
208 opts_len = max([len(line[0]) for line in opt_output])
204 # description
209 ui.write(_(b"Options:\n\n"))
205 ui.write(b"%s\n\n" % d[b'desc'][1])
210 multioccur = False
206 # options
211 for optstr, desc in opt_output:
207 opt_output = list(d[b'opts'])
212 if desc:
208 if opt_output:
213 s = b"%-*s %s" % (opts_len, optstr, desc)
209 opts_len = max([len(line[0]) for line in opt_output])
214 else:
210 ui.write(_(b"Options:\n\n"))
215 s = optstr
211 multioccur = False
216 ui.write(b"%s\n" % s)
212 for optstr, desc in opt_output:
217 if optstr.endswith(b"[+]>"):
213 if desc:
218 multioccur = True
214 s = b"%-*s %s" % (opts_len, optstr, desc)
219 if multioccur:
215 else:
220 ui.write(_(b"\n[+] marked option can be specified"
216 s = optstr
221 b" multiple times\n"))
217 ui.write(b"%s\n" % s)
222 ui.write(b"\n")
218 if optstr.endswith(b"[+]>"):
223 # aliases
219 multioccur = True
224 if d[b'aliases']:
220 if multioccur:
225 ui.write(_(b" aliases: %s\n\n") % b" ".join(d[b'aliases']))
221 ui.write(_(b"\n[+] marked option can be specified"
222 b" multiple times\n"))
223 ui.write(b"\n")
224 # aliases
225 if d[b'aliases']:
226 ui.write(_(b" aliases: %s\n\n") % b" ".join(d[b'aliases']))
226
227
227
228
228 def allextensionnames():
229 def allextensionnames():
General Comments 0
You need to be logged in to leave comments. Login now