Skip to content

Commit

Permalink
Improved coloring output section with OutputFormatterStyle and colors…
Browse files Browse the repository at this point in the history
…/options list
  • Loading branch information
raulfraile authored and weaverryan committed Mar 19, 2012
1 parent 019302f commit bbeb396
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions components/console.rst
Expand Up @@ -117,6 +117,18 @@ output. For example::
// white text on a red background
$output->writeln('<error>foo</error>');

It is possible to define your own styles using the class
:class:`Symfony\\Component\\Console\\Formatter\\OutputFormatterStyle`:

$style = new OutputFormatterStyle('red', 'yellow', array('bold', 'blink'));
$output->getFormatter()->setStyle('fire', $style);
$output->writeln('<fire>foo</fire>');

Available foreground and background colors are: ``black``, ``red``, ``green``,
``yellow``, ``blue``, ``magenta``, ``cyan`` and ``white``.

And available options are: 'bold', 'underscore', 'blink', 'reverse' and 'conceal'.

Using Command Arguments
-----------------------

Expand Down

0 comments on commit bbeb396

Please sign in to comment.