Skip to content

Commit

Permalink
feat:cli:readme
Browse files Browse the repository at this point in the history
  • Loading branch information
onanying committed Aug 5, 2021
1 parent d62120f commit 0166826
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ composer require mix/cli
```php
Mix\Cli\Cli::setName('app')->setVersion('0.0.0-alpha');
$cmd = new Mix\Cli\Command([
'name'=>'hello',
'short'=> 'Echo demo',
'run'=> function () {
'name' => 'hello',
'short' => 'Echo demo',
'run' => function () {
$name = Mix\Cli\Flag::match('n', 'name')->string('default');
// do something
}
Expand Down Expand Up @@ -154,9 +154,9 @@ $h = function ($next) {
}
};
$cmd = new Mix\Cli\Command([
'name'=>'hello',
'short'=> 'Echo demo',
'run'=> function () {
'name' => 'hello',
'short' => 'Echo demo',
'run' => function () {
// do something
}
]);
Expand Down Expand Up @@ -187,9 +187,9 @@ Mix\Cli\Cli::app()->debug

~~~php
$cmd = new Mix\Cli\Command([
'name'=>'hello',
'short'=> 'Echo demo',
'run'=> function () {
'name' => 'hello',
'short' => 'Echo demo',
'run' => function () {
// do something
},
'singleton' => true,
Expand Down

0 comments on commit 0166826

Please sign in to comment.