https://github.com/gabrieljmj/writeln
Fast and simple Symfony Console command creation
https://github.com/gabrieljmj/writeln
Last synced: 4 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 (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-03T19:00:13.000Z (over 10 years ago)
- Last Synced: 2025-01-23T14:31:20.017Z (5 months 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

=======
[](https://travis-ci.org/GabrielJMJ/Writeln) [](https://packagist.org/packages/gabrieljmj/writeln) [](https://packagist.org/packages/gabrieljmj/writeln) [](https://packagist.org/packages/gabrieljmj/writeln) [](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
```