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

// set to run indefinitely if needed
set_time_limit(0);

// include the composer autoloader
if (file_exists(__DIR__ . '/../../autoload.php')) {
    require __DIR__ . '/../../autoload.php';
} else {
    require __DIR__ . '/vendor/autoload.php';
}

// import the Symfony Console Application
use Symfony\Component\Console\Application;


$env = DidbotCmd\Factories\EnvFactory::getEnv(__DIR__ . '/.env');
$client = DidbotCmd\Factories\GuzzleFactory::getClient();

$cli = new Application();
$cli->add(new DidbotCmd\Commands\AddCommand($client));
$cli->add(new DidbotCmd\Commands\ConfigApiTokenCommand($env));
$cli->add(new DidbotCmd\Commands\ConfigBaseUrlCommand($env));

// Default to the AddDid command
$cli->setDefaultCommand('add');

$cli->run();
?>