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

use Symfony\Component\Console\Application;
use Which\Cli\Command;

// Load the dependencies.
$autoloader = new SplFileInfo(__DIR__."/../../../autoload.php");
$rootPath = (new SplFileInfo(__DIR__))->getPath();
require_once $autoloader->isFile() ? $autoloader->getPathname() : "$rootPath/vendor/autoload.php";

// Start the application.
$application = new Application("Which.php", require "$rootPath/src/Cli/version.g.php");
$command = (new Command)->setProcessTitle($application->getName());
$application->add($command);
$application->setDefaultCommand($command->getName(), true)->run();
