mateodioev / php-easy-cli
Create cli apps
v2.0
2023-02-12 19:38 UTC
Requires
- ext-readline: *
- php-parallel-lint/php-console-color: ^1.0
README
Installation
composer require mateodioev/php-easy-cli
Usage
use Mateodioev\PhpEasyCli\{App, Color, Context, Printer}; $app = new App($argv); $app->register('help', function(Context $ctx, Printer $printer) { $printer->display('Default command is help!!'); }); $app->register('hello', function(Context $ctx, Printer $printer) { $printer->display('Hello ' . $ctx->get('name', true, 'User name')); }); $app->run();
php script.php hello --name=Mateo