|
3 | 3 | <p align="center">
|
4 | 4 | <img src="https://img.shields.io/badge/License-MIT-f1c40f" alt="License">
|
5 | 5 | <img src="https://img.shields.io/badge/PHP-7.2-3498db.svg" alt="PHP version">
|
6 |
| - <img src="https://img.shields.io/badge/version-1.7.0-2c3e50.svg" alt="Version"> |
| 6 | + <img src="https://img.shields.io/badge/version-1.8.0-2c3e50.svg" alt="Version"> |
7 | 7 | <img src="https://img.shields.io/badge/coverage-40%25-27ae60.svg" alt="Coverage">
|
8 | 8 | <img src="https://travis-ci.org/lotfio/conso.svg?branch=master" alt="Build Status">
|
9 | 9 | <img src="https://github.styleci.io/repos/165832668/shield?branch=master" alt="StyleCi">
|
@@ -195,6 +195,38 @@ $conso->command("test", function($input, $output){
|
195 | 195 | ```
|
196 | 196 | 
|
197 | 197 |
|
| 198 | +### :star: commands namespace |
| 199 | + - you can wrap commands in the same namespace with `namespace()` method which makes things cleaner |
| 200 | + |
| 201 | +```php |
| 202 | +<?php |
| 203 | + |
| 204 | +$conso->namespace('Conso\\Commands', function($conso){ |
| 205 | + |
| 206 | + // all commands withing Conso\Commands namespace |
| 207 | + $conso->command("command", Command::class); |
| 208 | + $conso->command("test", Test::class); |
| 209 | + $conso->command("make", Make::class); |
| 210 | + |
| 211 | +}); |
| 212 | + |
| 213 | +``` |
| 214 | +### :star: group commands |
| 215 | + - you can group commands using the `group()` method |
| 216 | +```php |
| 217 | +<?php |
| 218 | + |
| 219 | +$conso->group('my group of commands:', function($conso){ |
| 220 | + |
| 221 | + $conso->command("command", function(){})->description('This is command description'); |
| 222 | + $conso->command("test", function(){})->description('This is command description'); |
| 223 | + $conso->command("make", function(){})->description('This is command description'); |
| 224 | + |
| 225 | +}); |
| 226 | + |
| 227 | +``` |
| 228 | + |
| 229 | + |
198 | 230 | ### :star: class commands
|
199 | 231 | - class commands are very helpful for big commands
|
200 | 232 | - first you need to create an `app/Commands` folder.
|
|
0 commit comments