gabrieljmj/writeln
Composer 安装命令:
composer require gabrieljmj/writeln
包简介
Fast and simple Symfony Console command creation
README 文档
README
Fast and simple Symfony Console command creation
Usage example
#!/usr/bin/env php <?php require 'vendor/autoload.php'; use Gabrieljmj\Wwriteln\Wwriteln; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputArgument; $cl = new Writeln(); $cl->command('hello', [ $cl->argument('name', InputArgument::REQUIRED, 'Your name') ], [ $cl->option('uppercase', 'u', InputOption::VALUE_NONE) ], function (InputInterface $input, OutputInterface $output) { $txt = $input->getOption('uppercase') ? strtoupper('Hello ' . $input->getArgument('name')) : 'Hello ' . $input->getArgument('name'); $output->writeln($txt); }); $cl->run();
$ bin hello Gabriel Hello Gabriel $ bin hello Gabriel -u HELLO GABRIEL
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-03-03