Files
FendxPHP/fendx-cli

27 lines
562 B
Plaintext
Raw Permalink Normal View History

#!/usr/bin/env php
<?php
declare(strict_types=1);
// 自动加载
require_once __DIR__ . '/../vendor/autoload.php';
use Fendx\CLI\Application;
use Fendx\CLI\Command;
// 创建应用
$app = new Application('FendxCLI', '1.0.0');
// 注册默认命令
$app->registerDefaultCommands();
// 注册自定义命令
$app->add(new Command\ListCommand());
$app->add(new Command\HelpCommand());
$app->add(new Command\VersionCommand());
// 加载项目命令
$app->loadCommandsFromDirectory(__DIR__ . '/commands', 'Fendx\\CLI\\Commands');
// 运行应用
$app->run();