##// END OF EJS Templates
help: roll option list header into option formatter
Matt Mackall -
r22116:161085f8 default
parent child Browse files
Show More
@@ -31,7 +31,7 b' def extshelp():'
31 31 doc = ''.join(rst)
32 32 return doc
33 33
34 def optrst(options, verbose):
34 def optrst(header, options, verbose):
35 35 data = []
36 36 multioccur = False
37 37 for option in options:
@@ -59,7 +59,8 b' def optrst(options, verbose):'
59 59
60 60 data.append((so, lo, desc))
61 61
62 rst = minirst.maketable(data, 1)
62 rst = ['\n%s:\n\n' % header]
63 rst.extend(minirst.maketable(data, 1))
63 64
64 65 if multioccur:
65 66 rst.append(_("\n[+] marked option can be specified multiple times\n"))
@@ -284,12 +285,11 b' def help_(ui, name, unknowncmd=False, fu'
284 285
285 286 # options
286 287 if not ui.quiet and entry[1]:
287 rst.append('\n%s\n\n' % _("options:"))
288 rst.append(optrst(entry[1], ui.verbose))
288 rst.append(optrst(_("options"), entry[1], ui.verbose))
289 289
290 290 if ui.verbose:
291 rst.append('\n%s\n\n' % _("global options:"))
292 rst.append(optrst(commands.globalopts, ui.verbose))
291 rst.append(optrst(_("global options"),
292 commands.globalopts, ui.verbose))
293 293
294 294 if not ui.verbose:
295 295 if not full:
@@ -366,8 +366,8 b' def help_(ui, name, unknowncmd=False, fu'
366 366 if ui.quiet:
367 367 pass
368 368 elif ui.verbose:
369 rst.append(_("\nglobal options:\n"))
370 rst.append('\n%s\n' % optrst(commands.globalopts, ui.verbose))
369 rst.append('\n%s\n' % optrst(_("global options"),
370 commands.globalopts, ui.verbose))
371 371 if name == 'shortlist':
372 372 rst.append(_('\nuse "hg help" for the full list '
373 373 'of commands\n'))
@@ -857,7 +857,7 b' test deprecated option is hidden with tr'
857 857
858 858 (*) (glob)
859 859
860 flaggor:
860 options:
861 861
862 862 (some details hidden, use --verbose to show complete help)
863 863 #endif
General Comments 0
You need to be logged in to leave comments. Login now