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

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

// Load the dependencies.
$autoload = realpath(__DIR__.'/../../../autoload.php');
$rootPath = dirname(__DIR__);
require_once $autoload ? $autoload : "$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();
