diff --git a/pisi/cli/colors.py b/pisi/cli/colors.py index 676c18e8..a3ec8665 100644 --- a/pisi/cli/colors.py +++ b/pisi/cli/colors.py @@ -10,6 +10,8 @@ # Colors module provides some color codes for console output. +import pisi.context as ctx + colors = {'black' : "\033[30m", 'red' : "\033[31m", 'green' : "\033[32m", @@ -54,7 +56,7 @@ colors = {'black' : "\033[30m", def colorize(msg, color): """Colorize the given message for console output""" - if colors.has_key(color): + if colors.has_key(color) and not ctx.config.get_option('no_color'): return colors[color] + msg + colors['default'] else: return msg diff --git a/pisi/cli/commands.py b/pisi/cli/commands.py index 00faf0e9..111c0532 100644 --- a/pisi/cli/commands.py +++ b/pisi/cli/commands.py @@ -85,6 +85,8 @@ class Command(object): p.add_option("-n", "--dry-run", action="store_true", default=False, help = _("do not perform any action, just show what\ would be done")) + p.add_option("", "--no-color", action="store_true", default=False, + help = _("print like a man")) return p def options(self):