pablosanches/goliath

A simple framework to facilitate the development of CLI applications based on PHP command.

1.0.0 2017-08-09 19:49 UTC

This package is auto-updated.

Last update: 2024-04-26 05:53:55 UTC


README

687474703a2f2f692e696d6775722e636f6d2f766137453874582e706e67

Codacy Badge Build Status

A simple framework to facilitate the development of CLI applications based on PHP command.

Features

  • Routing of command line arguments
  • Short and long arguments
  • Automagic --help creation
  • Configuration

Requirements

PHP >=5.6

Example

use Goliath\Cli;

$app = new Goliath\Cli();

$app = new \Goliath\Cli(array(
    'debug' => true,
    'log.destination' => \Goliath\Logger::LOG_STDERR,
    'log.dir' => __DIR__
));

$app->command('hello-world:',
    function($name) {
        echo "Hello $name\n";
    })
    ->setHelp('Hello world example');

Installation

You only need to include the depency in the composer.

"require": {
    "pablosanches/goliath": "1.0.*"
}

And run the composer

$ composer install