From b7acea822dd762f5ae2a13f6611160f5f5c0f0d8 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 15 Dec 2025 14:09:53 +0000 Subject: [PATCH] feat: add --version flag with build time Added support for --version flag that displays the PHAR version (git tag or commit hash) along with the build timestamp. This helps users identify which version of the tool they are running. Changes: - Updated box.json to configure git-version and datetime placeholders - Modified bin/console to set application name and version using Box placeholders - Version automatically shows git tag (if available) or commit hash with build time --- bin/console | 2 +- box.json | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/console b/bin/console index ec086a9..c4dffcd 100755 --- a/bin/console +++ b/bin/console @@ -8,7 +8,7 @@ use Deviantintegral\Har\Command\SplitCommand; require_once __DIR__ . '/../vendor/autoload.php'; // Create the Application -$application = new Symfony\Component\Console\Application; +$application = new Symfony\Component\Console\Application('HAR Tools', '@git-version@ (built: @build-time@)'); $application->add(new SplitCommand()); diff --git a/box.json b/box.json index a6bd52a..777fde9 100644 --- a/box.json +++ b/box.json @@ -17,5 +17,8 @@ ], "compactors": [ "KevinGH\\Box\\Compactor\\Php" - ] + ], + "git-version": "git-version", + "datetime": "build-time", + "datetime-format": "Y-m-d H:i:s T" }