/
pph
27 lines (22 loc) · 779 Bytes
/
pph
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
require "./vendor/autoload.php";
if(php_sapi_name() !== 'cli') exit;
use Core\Transpiler;
use Minicli\App;
use Minicli\Command\CommandCall;
use Minicli\Exception\CommandNotFoundException;
$app = new App([
'app_path' => __DIR__,
'theme' => '\Unicorn',
'debug' => false
]);
$app->registerCommand('compile', function (CommandCall $input) use($app) {
if($input->hasParam("in") && $input->hasParam("out")) {
$alt_explode = ($input->hasFlag("alt-explode"));
Transpiler::compile($app->getPrinter(), $input->getParam("in"), $input->getParam("out"), $alt_explode);
$app->getPrinter()->success("Success!");
} else {
$app->getPrinter()->error("You need to provide the in and out arguments.");
}
});
$app->runCommand($argv);