Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gabrieljmj/writeln
Fast and simple Symfony Console command creation
https://github.com/gabrieljmj/writeln
Last synced: about 2 months ago
JSON representation
Fast and simple Symfony Console command creation
- Host: GitHub
- URL: https://github.com/gabrieljmj/writeln
- Owner: gabrieljmj
- License: other
- Created: 2015-03-02T03:11:17.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-03T19:00:13.000Z (almost 10 years ago)
- Last Synced: 2023-08-21T10:27:34.085Z (over 1 year ago)
- Language: PHP
- Size: 137 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
![](http://i.imgur.com/JDZP2vC.gif)
=======
[![Build Status](https://travis-ci.org/GabrielJMJ/Writeln.svg)](https://travis-ci.org/GabrielJMJ/Writeln) [![License](https://img.shields.io/packagist/l/gabrieljmj/writeln.svg)](https://packagist.org/packages/gabrieljmj/writeln) [![Latest Unstable Version](https://img.shields.io/badge/unstable-dev--master-orange.svg)](https://packagist.org/packages/gabrieljmj/writeln) [![Total Downloads](https://img.shields.io/packagist/dt/gabrieljmj/wirteln.svg)](https://packagist.org/packages/gabrieljmj/writeln) [![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/gabrieljmj/writeln.svg)](https://scrutinizer-ci.com/g/GabrielJMJ/Writeln/?branch=dev)Fast and simple Symfony Console command creation
## Usage example
```php
#!/usr/bin/env php
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();
```
```console
$ bin hello Gabriel
Hello Gabriel$ bin hello Gabriel -u
HELLO GABRIEL
```