comparison mercurial/commands.py @ 1051:3c918b7ad8da

Clean up displaying help of global options, only one row per option.
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 26 Aug 2005 09:15:04 +0200
parents 9c09094de48c
children d8279ca39dc7
comparison
equal deleted inserted replaced
1050:9c09094de48c 1051:3c918b7ad8da
350 ui.write(' %-*s %s\n' % (m, f, h[f])) 350 ui.write(' %-*s %s\n' % (m, f, h[f]))
351 351
352 # global options 352 # global options
353 if ui.verbose: 353 if ui.verbose:
354 ui.write("\nglobal options:\n\n") 354 ui.write("\nglobal options:\n\n")
355 for s, l, d, c in globalopts: 355 opts, descriptions = [], []
356 opt = ' ' 356 for shortopt, longopt, default, desc in globalopts:
357 if s: 357 opts.append("%2s%s" %
358 opt = opt + '-' + s + ' ' 358 (shortopt and "-%s" % shortopt,
359 if l: 359 longopt and " --%s" % longopt))
360 opt = opt + '--' + l + ' ' 360 descriptions.append(desc)
361 if d: 361 opts_len = max(map(len, opts))
362 opt = opt + '(' + str(d) + ')' 362 for opt, desc in zip(opts, descriptions):
363 ui.write(opt, "\n") 363 ui.write(" %-*s %s\n" % (opts_len, opt, desc))
364 if c:
365 ui.write(' %s\n' % c)
366 364
367 # Commands start here, listed alphabetically 365 # Commands start here, listed alphabetically
368 366
369 def add(ui, repo, *pats, **opts): 367 def add(ui, repo, *pats, **opts):
370 '''add the specified files on the next commit''' 368 '''add the specified files on the next commit'''