Merge pull request #321 from ajgarlag/fix-output-color

Fix output colors for single type commands
This commit is contained in:
Jeremy Mikola 2013-07-02 13:48:40 -07:00
commit 5bee33eec9
2 changed files with 4 additions and 4 deletions

View file

@ -125,18 +125,18 @@ class PopulateCommand extends ContainerAwareCommand
private function populateIndexType(OutputInterface $output, $index, $type, $reset)
{
if ($reset) {
$output->writeln(sprintf('Resetting: %s/%s', $index, $type));
$output->writeln(sprintf('<info>Resetting</info> <comment>%s/%s</comment>', $index, $type));
$this->resetter->resetIndexType($index, $type);
}
$loggerClosure = function($message) use ($output, $index, $type) {
$output->writeln(sprintf('Populating: %s/%s, %s', $index, $type, $message));
$output->writeln(sprintf('<info>Populating</info> %s/%s, %s', $index, $type, $message));
};
$provider = $this->providerRegistry->getProvider($index, $type);
$provider->populate($loggerClosure);
$output->writeln(sprintf('Refreshing: %s', $index));
$output->writeln(sprintf('<info>Refreshing</info> <comment>%s</comment>', $index));
$this->indexManager->getIndex($index)->refresh();
}
}

View file

@ -61,7 +61,7 @@ class ResetCommand extends ContainerAwareCommand
}
if (null !== $type) {
$output->writeln(sprintf('Resetting: %s/%s', $index, $type));
$output->writeln(sprintf('<info>Resetting</info> <comment>%s/%s</comment>', $index, $type));
$this->resetter->resetIndex($index, $type);
} else {
$indexes = null === $index