Fix output

This commit is contained in:
Mattia Basaglia 2015-08-16 00:10:46 +02:00
parent f907bbd605
commit d45cdc6cff

View file

@ -201,6 +201,11 @@ class IRCColorOutput extends PlaintextColorOutput
}
function color( Color $color )
{
return "\x03".$this->color_code($color);
}
function color_code( Color $color )
{
if ( $color->bright )
{
@ -239,9 +244,14 @@ class AnsiColorOutput extends PlainTextColorOutput
}
function color( Color $color )
{
return "\x1b[".$this->color_code($color)."m";
}
function color_code( Color $color )
{
$bold = $color->bright ? "1" : "22";
return "\x1b[{$color->color};{$bold}m";
return (30+$color->color).";{$bold}";
}
}
@ -262,6 +272,11 @@ class BashColorOutput extends AnsiColorOutput
{
return $char == '\\' ? '\\\\' : $char;
}
function color( Color $color )
{
return "\\x1b[".$this->color_code($color)."m";
}
}
$dir = isset($argv[1]) ? $argv[1] : getcwd();