#!/usr/bin/php
<?php

if (php_sapi_name() !== 'cli') {
    exit;
}

require_once __DIR__ . "/vendor/autoload.php";

use App\Core\Application;
use App\Core\Config;
use App\Core\Command_Container;
use App\IO\Output;
use App\IO\Input;

// Get any user set config values
$config = Config::load(__DIR__ . "/App/config.ini")->get();
$command_container = new Command_Container($config, $argv);

$app = Application::load($command_container);


$app->set('hello-world', function () {
    $out = new Output;
    $out->error('Hello World');
    $out->message('Hello World');
    $out->alert('Hello World');
    $out->warning('Hello World');
    $out->info('Hello World');
    $out->success('Hello World');
    Output::error('Static Call');

    if (Input::affirm("Would you like to continue? Y/n")) {
        Output::success('CONTINUE');
    }

    if (Input::warnAffirm('This cannot be undone are you sure? Yes/No', ['Yes', 'No'])) {
        Output::success('warn continue');
    }
});

$app->set('world', 'App\Commands\Hello\Test@test');


$app->run();
