Skip to content

Commit 28bd7a2

Browse files
committed
sytle: update readme, add more doc on readme
1 parent bb7c1ec commit 28bd7a2

File tree

1 file changed

+55
-9
lines changed

1 file changed

+55
-9
lines changed

README.md

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,20 @@
1818
> 使用方便简单。可以方便的整合到任何已有项目中。
1919
2020
- 命令行应用, 命令行的 `controller`, `command` 解析运行
21-
- 支持给命令设置别名,一个命令可以有多个别名。支持命令的显示/隐藏,启用/禁用
22-
- 功能全面的命令行的选项参数解析(命名参数,短选项 `-s`,长选项 `--long`)
23-
- 命令行下的 输入`input`, 输出 `output` 管理、使用
24-
- 命令方法注释自动解析为帮助信息(默认提取 `@usage` `@arguments` `@options` `@example` 等信息)
21+
- 支持给命令设置别名,一个命令可以有多个别名。
22+
- 支持命令的显示/隐藏,启用/禁用
23+
- 命令行下的 输入`input`, 输出 `output`, Flag解析管理、使用
24+
- 功能全面的命令行的选项、参数解析
25+
- 命名参数,数组参数
26+
- 选项绑定 短选项 `-s`,长选项 `--long`
27+
- 支持定义数据类型(`bool,int,string,array`),解析后会自动格式化输入值
28+
- 命令方法注释自动解析为帮助信息
29+
- 默认提取 `@usage` `@arguments` `@options` `@example` 等信息
30+
- **NEW** v4 版本支持从注释定义选项参数的数据类型
31+
- 支持注册事件监听,错误处理等
32+
33+
### 更多特性
34+
2535
- 支持输出多种颜色风格的消息文本(`info`, `comment`, `success`, `warning`, `danger`, `error` ... )
2636
- 常用的特殊格式信息显示(`section`, `panel`, `padding`, `helpPanel`, `table`, `tree`, `title`, `list`, `multiList`)
2737
- 丰富的动态信息显示(`pending/loading`, `pointing`, `spinner`, `counterTxt`, `dynamicText`, `progressTxt`, `progressBar`)
@@ -43,13 +53,43 @@
4353
4454
## 快速安装
4555

56+
- Requirement php 7.3+
57+
4658
```bash
4759
composer require inhere/console
4860
```
4961

62+
## 快速开始
63+
64+
```php
65+
// file: examples/app
66+
use Inhere\Console\IO\Input;
67+
use Inhere\Console\IO\Output;
68+
69+
$meta = [
70+
'name' => 'My Console App',
71+
'version' => '1.0.2',
72+
];
73+
74+
// 通常无需传入 $input $output ,会自动创建
75+
// $app = new \Inhere\Console\Application($meta, $input, $output);
76+
$app = new \Inhere\Console\Application($meta);
77+
78+
// 注册命令
79+
$app->command(DemoCommand::class);
80+
// 注册命令组
81+
$app->addGroup(MyController::class);
82+
// ... ...
83+
84+
// run
85+
$app->run();
86+
```
87+
5088
## 文档列表
5189

52-
> 请到WIKI查看详细的使用文档
90+
请到[WIKI](https://github.com/inhere/php-console/wiki)查看更多详细的使用文档
91+
92+
5393

5494
- **[文档首页](https://github.com/inhere/php-console/wiki/home)**
5595
- **[功能概览](https://github.com/inhere/php-console/wiki/overview)**
@@ -98,12 +138,18 @@ $ php examples/app --debug 4
98138
- [kite](https://github.com/inhere/kite) PHP编写的,方便本地开发和使用的个人CLI工具应用
99139
- More, please see [github used by](https://github.com/inhere/php-console/network/dependents?package_id=UGFja2FnZS01NDI5NzMxOTI%3D)
100140

101-
## License
102-
103-
[MIT](LICENSE)
104-
105141
## 我的其他项目
106142

107143
- [inhere/php-validate](https://github.com/inhere/php-validate) 一个简洁小巧且功能完善的php验证库
108144
- [inhere/sroute](https://github.com/inhere/php-srouter) 轻量且快速的HTTP请求路由库
109145

146+
## 依赖包
147+
148+
- [toolkit/cli-utils](https://github.com/php-toolkit/cli-utils)
149+
- [toolkit/pflag](https://github.com/php-toolkit/pflag)
150+
- [toolkit/stdlib](https://github.com/php-toolkit/stdlib)
151+
- [toolkit/sys-utils](https://github.com/php-toolkit/sys-utils)
152+
153+
## License
154+
155+
[MIT](LICENSE)

0 commit comments

Comments
 (0)