This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Simple command line argument interpreter

1.0.3 2020-03-31 17:23 UTC

This package is auto-updated.

Last update: 2021-06-29 01:48:19 UTC


Simple command line argument interpreter.

Supports both shorthand single-dash arguments and extended double-dash arguments.

# console -w src/ -x "composer run lint"

$argv = \Console\CommandLine::parse($_SERVER['argv']);
$argv['w'] === 'src/';
$argv['x'] === 'composer run lint';
# console --dry-run --watch src/ --exec "composer run lint"

$argv = \Console\CommandLine::parse($_SERVER['argv']);
$argv['dry-run'] === true;
$argv['watch'] === 'src/';
$argv['exec'] === 'composer run lint';