#!/usr/bin/php
<?php

/** 
 * This script allow only local users to execute modules via command line
 * 
 * @example ./vendor/bin/m-commander -h This will display m-commander help page
 * @example ./vendor/bin/m-commander namespace\\to\\my\\module 
 * @example ./vendor/bin/m-commander namespace\\to\\my\\module -h This will display particular module help page
 * @example ./vendor/bin/m-commander namespace\\to\\my\\module -v Execute module with verbose mode
 * 
 * @author Wojciech Brozyna <wojciech.brozyna@gmail.com>
 * @license https://github.com/200MPH/m-commander/blob/master/LICENSE
 * @link https://github.com/200MPH/m-commander/
 */

use mcommander\Cli;

/* 
 * Autoloading
 * If you installed this library via composer, the best option is to leave below code as is
 * If you have your own autoloader include it here
 */
require_once __DIR__ . '/../composer-autoload.php';

try {
    
    $cli = new Cli();
            
    $cli->despatch($argc, $argv);
            
} catch (RuntimeException $re) {

    Cli::renderException($re);
        
} catch(Exception $e) {
    
    Cli::renderException($e);
  
}