Tweak colors in the output, make sure we load the proper version according to stability flags and add outdated command, refs #5028
parent
9206c646a2
commit
e7069dd5e8
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\Command;
|
||||
|
||||
use Composer\Util\ProcessExecutor;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\StringInput;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
/**
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
*/
|
||||
class OutdatedCommand extends ShowCommand
|
||||
{
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('outdated')
|
||||
->setDescription('Shows a list of installed packages including their latest version.')
|
||||
->setDefinition(array(
|
||||
new InputArgument('package', InputArgument::OPTIONAL, 'Package to inspect. Or a name including a wildcard (*) to filter lists of packages instead.'),
|
||||
))
|
||||
->setHelp(<<<EOT
|
||||
The outdated command is just a proxy for `composer show -l`
|
||||
|
||||
The color coding for dependency versions is as such:
|
||||
|
||||
- green: Dependency is in the latest version and is up to date.
|
||||
- yellow: Dependency has a new version available that includes backwards
|
||||
compatibility breaks according to semver, so upgrade when you can but it
|
||||
may involve work.
|
||||
- red: Dependency has a new version that is semver-compatible and you should upgrade it.
|
||||
|
||||
|
||||
EOT
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
// create new input without "global" command prefix
|
||||
$input = new StringInput('show --latest '.ProcessExecutor::escape($input->getArgument('package')));
|
||||
|
||||
return $this->getApplication()->run($input, $output);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue