Files
jsonedit/src/entry.php

25 lines
550 B
PHP
Raw Normal View History

2024-10-01 18:46:03 +02:00
<?php
require_once __DIR__."/../vendor/autoload.php";
$filename = $argv[1]??null; // ?(__DIR__."/../composer.json");
$terminal = new NoccyLabs\JEdit\Terminal\Terminal();
$editor = new NoccyLabs\JEdit\Editor\Editor($terminal);
if ($filename) {
$editor->loadFile($filename);
} else {
$editor->loadDocument((object)[]);
}
set_exception_handler(function (\Throwable $t) use ($terminal) {
register_shutdown_function(function () use ($t, $terminal) {
$terminal->shutdown();
echo $t."\n";
});
});
$editor->run();