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

use GT\Cli\Application;
use GT\Cli\Argument\CommandArgumentList;
use GT\Cron\Cli\RunCommand;

$autoloadLocations = [
	getcwd() . "/vendor/autoload.php",
	__DIR__ . "/../../../autoload.php",
	__DIR__ . "/../vendor/autoload.php",
];
foreach($autoloadLocations as $location) {
	if(file_exists($location)) {
		require($location);
		break;
	}
}

$app = new Application(
	"Time-based job scheduler",
	new CommandArgumentList("run", ...$argv),
	new RunCommand()
);
$app->run();
