##// 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 doc = ''.join(rst)
31 doc = ''.join(rst)
32 return doc
32 return doc
33
33
34 def optrst(options, verbose):
34 def optrst(header, options, verbose):
35 data = []
35 data = []
36 multioccur = False
36 multioccur = False
37 for option in options:
37 for option in options:
@@ -59,7 +59,8 b' def optrst(options, verbose):'
59
59
60 data.append((so, lo, desc))
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 if multioccur:
65 if multioccur:
65 rst.append(_("\n[+] marked option can be specified multiple times\n"))
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 # options
286 # options
286 if not ui.quiet and entry[1]:
287 if not ui.quiet and entry[1]:
287 rst.append('\n%s\n\n' % _("options:"))
288 rst.append(optrst(_("options"), entry[1], ui.verbose))
288 rst.append(optrst(entry[1], ui.verbose))
289
289
290 if ui.verbose:
290 if ui.verbose:
291 rst.append('\n%s\n\n' % _("global options:"))
291 rst.append(optrst(_("global options"),
292 rst.append(optrst(commands.globalopts, ui.verbose))
292 commands.globalopts, ui.verbose))
293
293
294 if not ui.verbose:
294 if not ui.verbose:
295 if not full:
295 if not full:
@@ -366,8 +366,8 b' def help_(ui, name, unknowncmd=False, fu'
366 if ui.quiet:
366 if ui.quiet:
367 pass
367 pass
368 elif ui.verbose:
368 elif ui.verbose:
369 rst.append(_("\nglobal options:\n"))
369 rst.append('\n%s\n' % optrst(_("global options"),
370 rst.append('\n%s\n' % optrst(commands.globalopts, ui.verbose))
370 commands.globalopts, ui.verbose))
371 if name == 'shortlist':
371 if name == 'shortlist':
372 rst.append(_('\nuse "hg help" for the full list '
372 rst.append(_('\nuse "hg help" for the full list '
373 'of commands\n'))
373 'of commands\n'))
@@ -857,7 +857,7 b' test deprecated option is hidden with tr'
857
857
858 (*) (glob)
858 (*) (glob)
859
859
860 flaggor:
860 options:
861
861
862 (some details hidden, use --verbose to show complete help)
862 (some details hidden, use --verbose to show complete help)
863 #endif
863 #endif
General Comments 0
You need to be logged in to leave comments. Login now