From 467653e0e6142c70add6b6f8c6868ec3b5a4813f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Fr=C3=B6mer?= Date: Tue, 4 Jan 2022 16:36:40 +0100 Subject: [PATCH] Resolve #140: Add --version output for binary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreas Frömer --- CHANGELOG.md | 3 +++ bin/composer-unused | 2 +- src/Console/Command/UnusedCommand.php | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67570f4e..c8a913b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,12 @@ # Changelog ## [Unreleased] - TBA +### Fixed +- Fixed version output when running `bin/composer-unused --version` ### Added - Added CLI argument `composer-json` which can be used to parse external projects. This will default to the current working directory. +- Added error message when `composer.json` is not readable ### Changed - Change `bin/composer-unused` to be used as standalone binary - Package type is now `library` instead of `composer-plugin` diff --git a/bin/composer-unused b/bin/composer-unused index 3ad7071a..dd874ac6 100755 --- a/bin/composer-unused +++ b/bin/composer-unused @@ -38,7 +38,7 @@ use Symfony\Component\Console\Input\ArgvInput; /** @var ContainerInterface $container */ $container = require __DIR__ . '/../config/container.php'; - $application = new Application(); + $application = new Application('composer-unused', UnusedCommand::VERSION); $application->add($container->get(UnusedCommand::class)); $application->setDefaultCommand('unused', true); diff --git a/src/Console/Command/UnusedCommand.php b/src/Console/Command/UnusedCommand.php index 01e1e735..3906e768 100644 --- a/src/Console/Command/UnusedCommand.php +++ b/src/Console/Command/UnusedCommand.php @@ -30,6 +30,8 @@ final class UnusedCommand extends Command { + public const VERSION = '0.8.0'; + /** @var CollectConsumedSymbolsCommandHandler */ private $collectConsumedSymbolsCommandHandler; /** @var CollectRequiredDependenciesCommandHandler */