#!/usr/bin/env php
<?php
+declare(strict_types=1);
if (php_sapi_name() !== 'cli') {
exit;
require __DIR__ . '/vendor/autoload.php';
+use Cli\Commands\CommandError;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Symfony\Component\Console\Output\ConsoleOutput;
// Run the command and handle errors
try {
+ $output->writeln("<warn>WARNING: This CLI is in alpha testing.</warn>");
+ $output->writeln("<warn>There's a high chance of issues, and the CLI API is subject to change.</warn>");
+ $output->writeln("");
+
$app->run(null, $output);
+} catch (CommandError $error) {
+ $output = (new ConsoleOutput())->getErrorOutput();
+ $output->getFormatter()->setStyle('error', new OutputFormatterStyle('red'));
+ $output->writeln('<error>' . $error->getMessage() . '</error>');
+ exit(1);
} catch (Exception $error) {
$output = (new ConsoleOutput())->getErrorOutput();
$output->getFormatter()->setStyle('error', new OutputFormatterStyle('red'));