#!/usr/bin/env php
<?php

declare(strict_types=1);

/*
 * This file is part of the Contao release helper.
 *
 * (c) Leo Feyer
 *
 * @license LGPL-3.0-or-later
 */

include __DIR__.'/../vendor/autoload.php';

use Symfony\Component\Console\Application;
use Symfony\Component\Finder\Finder;

$application = new Application('Contao release helper', '@package_version@');

$finder = (new Finder())
    ->files()
    ->name('*Command.php')
    ->in(__DIR__.'/../src/Command')
;

/** @var SplFileInfo[] $finder */
foreach ($finder as $file) {
    $class = 'Contao\ReleaseHelper\Command\\'.$file->getBasename('.php');
    $application->add(new $class());
}

$application->run();
