2016-07-24 20:28:49 +02:00
|
|
|
#!/usr/bin/env php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This file is part of twigc.
|
|
|
|
*
|
2018-06-02 08:47:11 +02:00
|
|
|
* @author dana <dana@dana.is>
|
2016-07-24 20:28:49 +02:00
|
|
|
* @license MIT
|
|
|
|
*/
|
|
|
|
|
|
|
|
require_once __DIR__ . '/../src/bootstrap.php';
|
|
|
|
|
2018-06-02 08:47:11 +02:00
|
|
|
use Symfony\Component\Console\Output\ConsoleOutput;
|
|
|
|
use Dana\Twigc\PharCompiler;
|
|
|
|
|
2016-07-24 20:28:49 +02:00
|
|
|
$verbose = false;
|
|
|
|
$verboseArgs = ['v', 'vv', 'vvv', 'verbose', 'debug'];
|
|
|
|
|
|
|
|
foreach ( $argv as $arg ) {
|
2018-06-02 08:47:11 +02:00
|
|
|
if ( in_array(ltrim($arg, '-'), $verboseArgs, true) ) {
|
|
|
|
$verbose = true;
|
|
|
|
break;
|
|
|
|
}
|
2016-07-24 20:28:49 +02:00
|
|
|
}
|
|
|
|
|
2018-06-02 08:47:11 +02:00
|
|
|
(new PharCompiler(new ConsoleOutput(), $verbose))->compile('twigc.phar');
|