2017 © Pedro Peláez
 

library clapp

Parses command line arguments passed to a PHP script

image

webtrendi/clapp

Parses command line arguments passed to a PHP script

  • Wednesday, February 25, 2015
  • by patforg
  • Repository
  • 2 Watchers
  • 7 Stars
  • 79 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

CLAPP: Command Line Argument Parser For PHP

Build Status, (*1)

Parses command line arguments passed to a PHP script., (*2)

Usage


// Define accepted arguments $definitions = new \Clapp\CommandLineArgumentDefinition(array( "help|h" => "Shows help message", "message|m=s" => "Input message", "verbose|v+" => "Set level of verbose output", )); // Filter arguments based and validate according to definitions $filter = new \Clapp\CommandArgumentFilter($definitions, $argv); // Retrieve parameter if set if ($filter->getParam('h') !== false) { echo $definitions->getUsage(); exit(); } //if

Features

  • Simple definition syntax
  • Supports long and short arugment names (-v --verbose)
  • Supports repeated arguments (--name=bob --name=mary)
  • Supports multiple short arguments (-abc equivalent of -a -b -c)
  • Supports 2 ways of setting values (--name=bob or --name bob)
  • Supports double dash delimiter for trailing values
  • Creates detailed usage documentation using definitions

The Versions

25/02 2015

dev-master

9999999-dev

Parses command line arguments passed to a PHP script

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

console cli command line argument parsing

25/02 2015

dev-develop

dev-develop

Parses command line arguments passed to a PHP script

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

console cli command line argument parsing

25/02 2015

v1.0.1

1.0.1.0

Parses command line arguments passed to a PHP script

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

console cli command line argument parsing

11/04 2014

v1.0.0

1.0.0.0

Parses command line arguments passed to a PHP script

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

console cli command line argument parsing