jlaso/console-args
Composer 安装命令:
composer require jlaso/console-args
包简介
A wrapper for the argv global
README 文档
README
console-args
This is an wrapper for the argv global
The difference between arguments and options are:
- arguments are strings like
--help - options are strings like
--file=filename - other arguments without
--are not recognized because the magic of this wrapper is that doesn't matter the order of the arguments/options
Version
1.0.0
Installation
Add the module by composer.json, adding in require clause:
{
"jlaso/console-args": "1.0.0"
}
Sample of use
$consoleArgs = new ConsoleArgs($argv, array('help'), array('arg1', 'arg2'));
if($consoleArgs->hasHelp){
print <<<EOD
Please, use this arguments to invoke this command:
--help \tto see this help
--arg1=filename \tthe first argument
--arg2=filename\toptional, the second argument
EOD;
exit();
}
$arg1 = $consoleArgs->getArg1;
$arg2 = $consoleArgs->getArg2;
License
MIT
统计信息
- 总下载量: 62
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 4
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-11-13