1
0
Fork 0

Disable progress when no-ansi is specified, refs #3612

pull/3041/merge
Jordi Boggiano 2015-01-05 16:31:16 +00:00
parent e0d36e19eb
commit c58b7d917c
2 changed files with 16 additions and 0 deletions

View File

@ -16,6 +16,8 @@ use Composer\Composer;
use Composer\Console\Application;
use Composer\IO\IOInterface;
use Composer\IO\NullIO;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command as BaseCommand;
/**
@ -102,4 +104,16 @@ abstract class Command extends BaseCommand
{
$this->io = $io;
}
/**
* {@inheritDoc}
*/
protected function initialize(InputInterface $input, OutputInterface $output)
{
if (true === $input->hasParameterOption(array('--no-ansi')) && $input->hasOption('no-progress')) {
$input->setOption('no-progress', true);
}
parent::initialize($input, $output);
}
}

View File

@ -100,6 +100,8 @@ EOT
*/
protected function initialize(InputInterface $input, OutputInterface $output)
{
parent::initialize($input, $output);
if ($input->getOption('global') && 'composer.json' !== $input->getOption('file')) {
throw new \RuntimeException('--file and --global can not be combined');
}