1
0
Fork 0

Add highlight style

pull/149/head
Jordi Boggiano 2011-12-06 23:07:06 +01:00
parent 8675d4eb6a
commit c7deaa8a1f
1 changed files with 18 additions and 6 deletions

View File

@ -15,6 +15,9 @@ namespace Composer\Console;
use Symfony\Component\Console\Application as BaseApplication;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Formatter\OutputFormatter;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Symfony\Component\Finder\Finder;
use Composer\Command;
use Composer\Composer;
@ -40,12 +43,21 @@ class Application extends BaseApplication
}
/**
* Runs the current application.
*
* @param InputInterface $input An Input instance
* @param OutputInterface $output An Output instance
*
* @return integer 0 if everything went fine, or an error code
* {@inheritDoc}
*/
public function run(InputInterface $input = null, OutputInterface $output = null)
{
if (null === $output) {
$styles['highlight'] = new OutputFormatterStyle('red');
$formatter = new OutputFormatter(null, $styles);
$output = new ConsoleOutput(ConsoleOutput::VERBOSITY_NORMAL, null, $formatter);
}
return parent::run($input, $output);
}
/**
* {@inheritDoc}
*/
public function doRun(InputInterface $input, OutputInterface $output)
{