#!/usr/bin/env php
<?php
declare(strict_types = 1);

use GitStats\Application;
use GitStats\TaskRunner;

foreach ([__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php'] as $file) {
    if (file_exists($file)) {
        define('COMPOSER_INSTALL', $file);
        break;
    }
}
if (!defined('COMPOSER_INSTALL')) {
    echo 'Composer dependencies could not be found';
    die(1);
}

require COMPOSER_INSTALL;

$app = new Application;

$app->command('run url [tasks]* [--format=] [--max=]', [TaskRunner::class, 'run']);

$app->run();
