xcorp1986 / silly

Silly CLI micro-framework based on Symfony Console

Home Page:http://mnapoli.fr/silly/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

currentMenu
home

Silly CLI micro-framework based on Symfony Console.

Build Status Coverage Status Scrutinizer Code Quality Packagist

Installation

$ composer require mnapoli/silly

Usage

Example of a Silly application:

use Symfony\Component\Console\Output\OutputInterface;

$app = new Silly\Application();

$app->command('greet [name] [--yell]', function ($name, $yell, OutputInterface $output) {
    if ($name) {
        $text = 'Hello, '.$name;
    } else {
        $text = 'Hello';
    }

    if ($yell) {
        $text = strtoupper($text);
    }

    $output->writeln($text);
});

$app->run();

Running the application is the same as running any other Symfony Console application:

$ php application.php greet
Hello
$ php application.php greet john --yell
HELLO JOHN
$ php application.php greet --yell john
HELLO JOHN

Silly\Application extends Symfony\Console\Application and can be used wherever Symfony's Application can.

Documentation

Do more

Silly is just an implementation over the Symfony Console. Read the Symfony documentation to learn everything you can do with it.

Contributing

See the CONTRIBUTING file.

About

Silly CLI micro-framework based on Symfony Console

http://mnapoli.fr/silly/

License:MIT License


Languages

Language:PHP 82.9%Language:CSS 9.8%Language:HTML 7.3%