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

/*
 * This file is part of the hellonuzzle/bluetooth-fct package.
 *
 * @author: Alex Andreae
 * @license: GPL v3
 * @company: HelloNuzzle, Inc
 * @website: http://hellonuzzle.com
 *
 * (c) Alex Andreae <alzander@gmail.com> | <alex@hellonuzzle.com>
 *
 * Bluetooth-fct is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   Foobar is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with bluetooth-fct.  If not, see <http://www.gnu.org/licenses/>.
 */


use Webmozart\Console\ConsoleApplication;
use Alzander\BluetoothFCT\BluetoothFCTApplicationConfig;
use League\Flysystem\Filesystem;
use League\Flysystem\Adapter\Local;

if (file_exists($autoload = __DIR__.'/../../../autoload.php')) {
    $loader = require_once $autoload;
} else {
    $loader = require_once __DIR__.'/../vendor/autoload.php';
}

// Add the FCT namespace, allowing for custom validators
$loader->add('FCT', __DIR__);

$adapter = new Local(__DIR__ . '/fct');
$flysystem = new Filesystem($adapter);

$cliApp = new BluetoothFCTApplicationConfig($flysystem);

$cli = new ConsoleApplication($cliApp);
$cli->run();