ethnam/getopt

Ethnam 的 Getopt

v1.0.0 2015-05-05 03:34 UTC

This package is not auto-updated.

Last update: 2024-09-14 17:20:07 UTC


README

PEAR 的 Console_Getopt 的重新发明

安装

在你的 composer.json 中

{
  "require" : {
    "ethnam/getopt" : "1.*"
  }
}

用法

use Ethnam\Getopt\Getopt;
$opt = new Getopt();
$arg_list = $opt->readGlobalArgv();
array_shift($arg_list);  // remove commant itself
$opt->getopt($my_arg_list, "v", array("version"));

另见

http://pear.php.net/manual/en/package.console.console-getopt.php