2017 © Pedro Peláez
 

library console-args

A wrapper for the argv global

image

jlaso/console-args

A wrapper for the argv global

  • Friday, November 14, 2014
  • by jlaso
  • Repository
  • 1 Watchers
  • 0 Stars
  • 50 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 4 % Grown

The README.md

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

console-args

This is an wrapper for the argv global, (*2)

The difference between arguments and options are: * arguments are strings like --help * options are strings like --file=filename * other arguments without -- are not recognized because the magic of this wrapper is that doesn't matter the order of the arguments/options, (*3)

Version

1.0.0, (*4)

Installation

Add the module by composer.json, adding in require clause:, (*5)

{
    "jlaso/console-args": "1.0.0"
}

Sample of use

$consoleArgs = new ConsoleArgs($argv, array('help'), array('arg1', 'arg2'));

if($consoleArgs->hasHelp){
    print <<<EOD
        Please, use this arguments to invoke this command:

             --help       \tto see this help
             --arg1=filename \tthe first argument
             --arg2=filename\toptional, the second argument
EOD;
   exit();
}
$arg1 = $consoleArgs->getArg1;
$arg2 = $consoleArgs->getArg2;

License

MIT, (*6)

The Versions

14/11 2014

dev-master

9999999-dev https://github.com/jlaso/console-args

A wrapper for the argv global

  Sources   Download

MIT

The Requires

  • php >=5.3

 

console wrapper arguments argv

13/11 2014

1.0.0

1.0.0.0 https://github.com/jlaso/console-args

A wrapper for the $argv global

  Sources   Download

MIT

The Requires

  • php >=5.3

 

console wrapper arguments argv