enom/cli

Simple command line argument interpreter

1.0.3 2020-03-31 17:23 UTC

This package is auto-updated.

Last update: 2024-11-29 04:52:29 UTC


README

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';