Skip to content

Commit 591e1c1

Browse files
committed
updates for v 1.8.0
1 parent 56664cd commit 591e1c1

27 files changed

+63
-27
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.8.0
2+
- adding commands namespace method `namespace(string $namespace)`
3+
- adding commands group method `group(string $name)`
4+
15
# 1.7.0
26
- adding flag value support `--flag=value`
37
- fix options allow only alpha numeric

README.md

+33-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<p align="center">
44
<img src="https://img.shields.io/badge/License-MIT-f1c40f" alt="License">
55
<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">
77
<img src="https://img.shields.io/badge/coverage-40%25-27ae60.svg" alt="Coverage">
88
<img src="https://travis-ci.org/lotfio/conso.svg?branch=master" alt="Build Status">
99
<img src="https://github.styleci.io/repos/165832668/shield?branch=master" alt="StyleCi">
@@ -195,6 +195,38 @@ $conso->command("test", function($input, $output){
195195
```
196196
![image](https://user-images.githubusercontent.com/18489496/88392798-e94e7400-cdbc-11ea-8de6-5fab02cdfb01.png)
197197

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+
![image](https://user-images.githubusercontent.com/18489496/88970755-3fd31b00-d2b3-11ea-9860-2ff024a6a2dc.png)
229+
198230
### :star: class commands
199231
- class commands are very helpful for big commands
200232
- first you need to create an `app/Commands` folder.

commands.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* @author <[email protected]>
55
*
6-
* @version 1.7.0
6+
* @version 1.8.0
77
*
88
* @license MIT
99
*

src/Conso/Command.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

src/Conso/CommandInvoker.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

src/Conso/CommandLinker.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

src/Conso/Commands/Command.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

src/Conso/Commands/stubs/command

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* @author <[email protected]>
66
* @package Conso PHP Console Creator
7-
* @version 1.7.0
7+
* @version 1.8.0
88
* @license MIT
99
* @category CLI
1010
* @copyright 2019 Lotfio Lakehal

src/Conso/CommandsTable.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

src/Conso/Conso.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

src/Conso/ConsoTrait.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*
@@ -40,7 +40,7 @@ trait ConsoTrait
4040
*
4141
* @var string
4242
*/
43-
protected $version = '1.7.0';
43+
protected $version = '1.8.0';
4444

4545
/**
4646
* author.

src/Conso/Contracts/CommandInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

src/Conso/Contracts/InputInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

src/Conso/Contracts/OutputInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

src/Conso/Exceptions/InputException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

src/Conso/Exceptions/InvokerException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

src/Conso/Exceptions/OutputException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

src/Conso/Input.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

src/Conso/Output.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

src/Conso/hlprs.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

tests/Unit/CommandInvokerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

tests/Unit/CommandLinkerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

tests/Unit/CommandsTableTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

tests/Unit/ConsoTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

tests/Unit/InputTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

tests/Unit/Mocks/Make.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

tests/Unit/OutputTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author <[email protected]>
77
*
8-
* @version 1.7.0
8+
* @version 1.8.0
99
*
1010
* @license MIT
1111
*

0 commit comments

Comments
 (0)