From: Antoine Musso Date: Thu, 30 Sep 2004 17:39:57 +0000 (+0000) Subject: --color=light will bright diffs output X-Git-Tag: 1.5.0alpha1~1728 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/supprimer.php?a=commitdiff_plain;h=03956be7659aaf4bc6db1df6eb9411cc184b0eef;p=lhc%2Fweb%2Fwiklou.git --color=light will bright diffs output --- diff --git a/maintenance/parserTests.php b/maintenance/parserTests.php index 7cecbefd12..cc1d49cef7 100644 --- a/maintenance/parserTests.php +++ b/maintenance/parserTests.php @@ -30,8 +30,20 @@ $optionsWithArgs = array('regex'); require_once( 'commandLine.inc' ); require_once( 'languages/LanguageUtf8.php' ); +/** */ class ParserTest { - + /** + * boolean $color whereas output should be colorized + * @access private + */ + var $color; + + /** + * boolean $lightcolor whereas output should use light colors + * @access private + */ + var $lightcolor; + /** * Sets terminal colorization and diff/quick modes depending on OS and * command-line options (--color and --quick). @@ -40,10 +52,14 @@ class ParserTest { */ function ParserTest() { global $options; + $this->lightcolor = false; if( isset( $_SERVER['argv'] ) && in_array( '--color', $_SERVER['argv'] ) ) { $this->color = true; } elseif( isset( $_SERVER['argv'] ) && in_array( '--color=yes', $_SERVER['argv'] ) ) { $this->color = true; + } elseif( isset( $_SERVER['argv'] ) && in_array( '--color=light', $_SERVER['argv'] ) ) { + $this->color = true; + $this->lightcolor = true; } elseif( isset( $_SERVER['argv'] ) && in_array( '--color=no', $_SERVER['argv'] ) ) { $this->color = false; } elseif( wfIsWindows() ) { @@ -458,7 +474,11 @@ class ParserTest { * @access private */ function termColor( $color ) { - return $this->color ? "\x1b[{$color}m" : ''; + if($this->lightcolor) { + return $this->color ? "\x1b[1;{$color}m" : ''; + } else { + return $this->color ? "\x1b[{$color}m" : ''; + } } /**