#!/usr/bin/php -q
<?php

require_once __DIR__ . '/../vendor/autoload.php';
include_once __DIR__ . '/../config/locale_setup.php';

if (count($argv) != 3){
    echo 'wrong amount of parameters for this command';?>

usage example: ./create-user-role admin 10
    <?php
    exit(0);
}

echo $argv[1];
try {
    $config = new \Gvera\Helpers\config\Config();
    $entityManager = new \Gvera\Helpers\entities\GvEntityManager($config);
    $command = new \Gvera\Commands\CreateNewUserRoleCommand($argv[1], $argv[2], $entityManager);
    $command->execute();
} catch (Exception $e) {
    echo $e->getMessage();
    exit(0);
}

echo ' role generated successfully';