From de4072b0c398f9c2e2580942e5bde128b20d0f84 Mon Sep 17 00:00:00 2001
From: Seblu <sebastien.luttringer@smartjog.com>
Date: Fri, 18 Feb 2011 20:18:38 +0100
Subject: [PATCH] TqlCommand now handle --no-color option

---
 cccli/command/command.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/cccli/command/command.py b/cccli/command/command.py
index 5cc2933..6a934d0 100644
--- a/cccli/command/command.py
+++ b/cccli/command/command.py
@@ -92,9 +92,13 @@ class TqlCommand(OptionCommand):
         self.tdr = self.cli.tagdisplay.resolve
         self.tdc = self.cli.tagdisplay.color
         self.tdtc = self.cli.tagdisplay.titlecolor
-        self.add_option("--no-tagdisplay", action="callback", dest="tagdisplay",
+        self.add_option("--no-tagdisplay", action="callback",
                         callback=self._cb_notagdisplay,
                         help="No tagdisplay custom display")
+        self.add_option("--no-color", action="callback",
+                        callback=self._cb_nocolor,
+                        help="No output coloration")
+
 
     def _cb_notagdisplay(self, option, opt, value, parser):
         '''Callback for option --no-tagdisplay'''
@@ -102,6 +106,12 @@ class TqlCommand(OptionCommand):
         self.tdc = self.cli.tagdisplay.default_color
         self.tdtc = self.cli.tagdisplay.default_titlecolor
 
+    def _cb_nocolor(self, option, opt, value, parser):
+        '''Callback for option --no-color'''
+        self.tdr = lambda tagname, tagvalue: tagvalue
+        self.tdc = lambda tagname: ""
+        self.tdtc = lambda tagname: ""
+
     def _cb_raw(self, option, opt, value, parser):
         '''Callback for option --raw'''
         self.tql_filter = ""
-- 
GitLab