pangodream / php-simpcli
A simple PHP cli arguments parser
Installs: 17
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/pangodream/php-simpcli
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2025-09-29 02:21:00 UTC
README
A simple PHP cli arguments parser
Installation
composer require pangodream/php-simpcli
Usage:
require_once __DIR__.'/../vendor/autoload.php'; use PhpSimpcli\CliParser; $sp = new CliParser(); var_dump($sp->get('myOption'));
From the cli console:
php test.php -otherOption
["found"] => bool(false)
["value"] => NULL
["type"] => NULL
php test.php -myOption
["found"] => bool(true)
["value"] => NULL
["type"] => "missing"
php test.php -myOption Hello
["found"] => bool(true)
["value"] => "Hello"
["type"] => "single"
php test.php -myOption Hello World
["found"] => bool(true)
["value"] => array([0] => "Hello, [1] => "World")
["type"] => multi
php test.php -myOption Hello "Wonderful World"
["found"] => bool(true)
["value"] => array([0] => "Hello, [1] => "Wonderful World")
["type"] => multi