Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/wiki
Submodule wiki updated from 3751f1 to 6ba42b
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Show DevTools version metadata in CLI application output so `list` and `--version` expose the installed package version from `Application` metadata (#339).

## [1.25.3] - 2026-05-11

### Fixed
Expand Down
19 changes: 18 additions & 1 deletion src/Console/DevTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use FastForward\DevTools\SelfUpdate\SelfUpdateScopeResolverInterface;
use FastForward\DevTools\SelfUpdate\VersionCheckNotifierInterface;
use FastForward\DevTools\SelfUpdate\WorkingDirectorySwitcherInterface;
use Composer\InstalledVersions;
use Override;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
Expand All @@ -45,6 +46,10 @@
*/
final class DevTools extends Application
{
private const string PACKAGE = 'fast-forward/dev-tools';

private const string VERSION_UNKNOWN = '0.0.0';

private const string LOGO = <<<'LOGO'
____ _____ _
| _ \ _____ _|_ _|__ ___ | |___
Expand Down Expand Up @@ -85,12 +90,24 @@ public function __construct(
private readonly EnvironmentInterface $environment,
private readonly RuntimeEnvironmentInterface $runtimeEnvironment,
) {
parent::__construct('Fast Forward Dev Tools');
parent::__construct('Fast Forward Dev Tools', $this->resolveVersion());

$this->setDefaultCommand('dev-tools:standards');
$this->setCommandLoader($commandLoader);
}

/**
* Resolves the running DevTools version for command metadata.
*
* @return string the current package version or a safe fallback
*/
Comment thread
coisa marked this conversation as resolved.
Outdated
private function resolveVersion(): string
{
return InstalledVersions::getPrettyVersion(self::PACKAGE)
?? InstalledVersions::getVersion(self::PACKAGE)
?? self::VERSION_UNKNOWN;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
}

/**
* Returns the application-level input definition with DevTools runtime options.
*
Expand Down
1 change: 1 addition & 0 deletions tests/Console/DevToolsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ public function __construct()
->willReturn($customCommand);

self::assertSame('Fast Forward Dev Tools', $this->devTools->getName());
self::assertMatchesRegularExpression('/\\S+/', $this->devTools->getVersion());
self::assertTrue($this->devTools->has('custom'));
self::assertSame($customCommand, $this->devTools->get('custom'));
}
Expand Down