From: Christian Weiske Date: Thu, 20 Mar 2014 20:27:16 +0000 (+0100) Subject: use ANSI color codes on shell by default X-Git-Tag: v0.5.0~9 X-Git-Url: https://git.cweiske.de/bdrem.git/commitdiff_plain/7e8bdb96bc0f2b1381fae9e9e29ce9773be0c2d5 use ANSI color codes on shell by default --- diff --git a/src/bdrem/Cli.php b/src/bdrem/Cli.php index 0525a37..3ecd4ea 100644 --- a/src/bdrem/Cli.php +++ b/src/bdrem/Cli.php @@ -40,6 +40,16 @@ class Cli extends UserInterface //set default renderer to console $parser->options['renderer']->default = 'console'; + $parser->addOption( + 'ansi', + array( + 'long_name' => '--no-color', + 'description' => 'Do not output ANSI color codes', + 'action' => 'StoreFalse', + 'default' => true + ) + ); + //only on CLI $parser->addCommand( 'readme', array( diff --git a/src/bdrem/UserInterface.php b/src/bdrem/UserInterface.php index de6d3bb..66b72e2 100644 --- a/src/bdrem/UserInterface.php +++ b/src/bdrem/UserInterface.php @@ -173,6 +173,9 @@ abstract class UserInterface $this->config->renderer = $result->options['renderer']; $this->config->stopOnEmpty = $result->options['stopOnEmpty']; $this->config->setDate($result->options['date']); + if (isset($result->options['ansi'])) { + $this->config->ansi = $result->options['ansi']; + } return $result; } catch (\Exception $exc) { $this->preRenderParameterError();