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

use Symfony\Component\Console\Application;
use Which\WhichCommand;

// 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", json_decode(file_get_contents(__DIR__."/../composer.json"))->version);
$command = new WhichCommand;
$application->add($command);
$application->setDefaultCommand($command->getName(), true)->run();
