2017 © Pedro Peláez
 

library php-cli

Parses cli arguments into array data for php use

image

corycollier/php-cli

Parses cli arguments into array data for php use

  • Tuesday, December 22, 2015
  • by corycollier
  • Repository
  • 1 Watchers
  • 0 Stars
  • 161 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

php-cli

Cli Tools for PHP, (*1)

Build Status Coverage Status, (*2)

Parser Usage

Using the Parser can be done like this:, (*3)

use PhpCli\Parser;
$parser = new PhpCli\Parser($argv, $argc);
print_r($parser->getArgs());

From the command line, arguments can be passed in like this:, (*4)

php script.php --arg=value arg2=value2

Output Usage

Using the output class can be done like this;, (*5)

use PhpCli\Output;
$output = new PhpCli\Output;
$output->write("hello world", array(
  'color' => 'red',
));

The Versions