定制 kilahm/clio 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kilahm/clio

最新稳定版本:0.2.2

Composer 安装命令:

composer require kilahm/clio

包简介

Command Line Input/Output for Hack.

README 文档

README

This package is a re-imagining of the wonderful League package Climate, except written in strict Hack.

WHY?!

I would really like to have useful tools for Hack. The primary advantage I see that Hack has over PHP is the static type checker. For the type checker to be useful, there needs to be statically typed libraries.

Usage

The API is unstable

For now I will list example code. This is one way in which I design my public facing APIs.

Construction

// Default input and output; same as not passing any input/output handlers to clio constructor
$input = new HackPack\Clio\StreamReader(STDIN);
$output = new HackPack\Clio\StreamWriter(STDOUT);
$clio = new HackPack\Clio\Clio($input, $output);

Parameters/Options

hhvm task.php "Some Call Me Tim" --with-title -t "Tim The Wizard"
// task.php
$clio = new HackPack\Clio\Clio();
$name = $clio->param('name')
             ->described('Description of the "name" argument.')
             ->required();
$titleFlag = $clio->flag('with-title')
$title = $clio->option('title')->aka('t')

Contributing

I would love to have feedback. Pull requests and issues are welcome!

统计信息

  • 总下载量: 63
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: Hack

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-17