Mercurial > hg
changeset 20455:a2c08adbb86e
color: add debugcolor command (issue4094)
This patch adds a debugcolor command that prints all
colors that the extension knows about.
author | Olle Lundberg <geek@nerd.sh> |
---|---|
date | Wed, 12 Feb 2014 01:00:51 +0100 |
parents | 47fd57f650e5 |
children | 9a49feb408f3 |
files | hgext/color.py |
diffstat | 1 files changed, 15 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/color.py Thu Jan 30 16:47:29 2014 -0800 +++ b/hgext/color.py Wed Feb 12 01:00:51 2014 +0100 @@ -426,6 +426,16 @@ _("when to colorize (boolean, always, auto, or never)"), _('TYPE'))) +def debugcolor(ui, repo, **opts): + global _styles + _styles = {} + for effect in _effects.keys(): + _styles[effect] = effect + ui.write(('colormode: %s\n') % ui._colormode) + ui.write(_('available colors:\n')) + for label, colors in _styles.items(): + ui.write(('%s\n') % colors, label=label) + if os.name != 'nt': w32effects = None else: @@ -555,3 +565,8 @@ finally: # Explicitly reset original attributes _kernel32.SetConsoleTextAttribute(stdout, origattr) + +cmdtable = { + 'debugcolor': + (debugcolor, [], ('hg debugcolor')) +}