1
0
Fork 0

Merge pull request #9960 from noniagriconomie/feature-about-version

Add Composer version in about command
pull/9975/head
Jordi Boggiano 2021-06-09 16:24:58 +02:00 committed by GitHub
commit 3afa0a2df6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -12,6 +12,7 @@
namespace Composer\Command; namespace Composer\Command;
use Composer\Composer;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
@ -24,7 +25,7 @@ class AboutCommand extends BaseCommand
{ {
$this $this
->setName('about') ->setName('about')
->setDescription('Shows the short information about Composer.') ->setDescription('Shows a short information about Composer.')
->setHelp( ->setHelp(
<<<EOT <<<EOT
<info>php composer.phar about</info> <info>php composer.phar about</info>
@ -35,9 +36,11 @@ EOT
protected function execute(InputInterface $input, OutputInterface $output) protected function execute(InputInterface $input, OutputInterface $output)
{ {
$composerVersion = Composer::getVersion();
$this->getIO()->write( $this->getIO()->write(
<<<EOT <<<EOT
<info>Composer - Dependency Manager for PHP</info> <info>Composer - Dependency Manager for PHP - version $composerVersion</info>
<comment>Composer is a dependency manager tracking local dependencies of your projects and libraries. <comment>Composer is a dependency manager tracking local dependencies of your projects and libraries.
See https://getcomposer.org/ for more information.</comment> See https://getcomposer.org/ for more information.</comment>
EOT EOT