mateodioev/php-easy-cli

Create cli apps

v2.0 2023-02-12 19:38 UTC

This package is auto-updated.

Last update: 2024-11-12 23:25:25 UTC


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