##// END OF EJS Templates
color: add the ability to display configured style to 'debugcolor'...
Pierre-Yves David -
r30286:d44c407a default
parent child Browse files
Show More
@@ -536,10 +536,15 b' def extsetup(ui):'
536 _("when to colorize (boolean, always, auto, never, or debug)"),
536 _("when to colorize (boolean, always, auto, never, or debug)"),
537 _('TYPE')))
537 _('TYPE')))
538
538
539 @command('debugcolor', [], 'hg debugcolor')
539 @command('debugcolor',
540 [('', 'style', None, _('show all configured styles'))],
541 'hg debugcolor')
540 def debugcolor(ui, repo, **opts):
542 def debugcolor(ui, repo, **opts):
541 """show available colors and effects"""
543 """show available color, effects or style"""
542 ui.write(('color mode: %s\n') % ui._colormode)
544 ui.write(('color mode: %s\n') % ui._colormode)
545 if opts.get('style'):
546 return _debugdisplaystyle(ui)
547 else:
543 return _debugdisplaycolor(ui)
548 return _debugdisplaycolor(ui)
544
549
545 def _debugdisplaycolor(ui):
550 def _debugdisplaycolor(ui):
@@ -564,6 +569,18 b' def _debugdisplaycolor(ui):'
564 finally:
569 finally:
565 _styles = oldstyle
570 _styles = oldstyle
566
571
572 def _debugdisplaystyle(ui):
573 ui.write(_('available style:\n'))
574 width = max(len(s) for s in _styles)
575 for label, effects in sorted(_styles.items()):
576 ui.write('%s' % label, label=label)
577 if effects:
578 # 50
579 ui.write(': ')
580 ui.write(' ' * (max(0, width - len(label))))
581 ui.write(', '.join(ui.label(e, e) for e in effects.split()))
582 ui.write('\n')
583
567 if os.name != 'nt':
584 if os.name != 'nt':
568 w32effects = None
585 w32effects = None
569 else:
586 else:
General Comments 0
You need to be logged in to leave comments. Login now