Skip to content

Commit bb7c1ec

Browse files
committed
sytle: update readme
1 parent 323ae9b commit bb7c1ec

File tree

3 files changed

+166
-166
lines changed

3 files changed

+166
-166
lines changed

README.en.md

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# PHP Console
2+
3+
[![License](https://img.shields.io/packagist/l/inhere/console.svg?style=flat-square)](LICENSE)
4+
[![Php Version](https://img.shields.io/badge/php-%3E=7.3.0-brightgreen.svg?maxAge=2592000)](https://packagist.org/packages/inhere/console)
5+
[![Latest Stable Version](http://img.shields.io/packagist/v/inhere/console.svg)](https://packagist.org/packages/inhere/console)
6+
[![Github Actions Status](https://github.com/inhere/php-console/workflows/Unit-tests/badge.svg)](https://github.com/inhere/php-console/actions)
7+
8+
Full-featured php command line application library.
9+
10+
Provide console parameter parsing, command run, color style output, user information interaction, and special format information display.
11+
12+
> **[中文README](./README.zh-CN.md)**
13+
14+
## Command line preview
15+
16+
![app-command-list](https://raw.githubusercontent.com/inhere/php-console/3.x/docs/screenshots/app-command-list.png)
17+
18+
## Features
19+
20+
> Easy to use. Can be easily integrated into any existing project.
21+
22+
- Command line application, `controller`, `command` parsing run on the command line
23+
- Support for setting aliases for commands. A command can have multiple aliases.
24+
- Support command display/hide, enable/disable.
25+
- Full-featured command line option parameter parsing (named parameters, short options `-s`, long options `--long`).
26+
- The `input`, `output` of the command line, management, use
27+
- Command method comments are automatically parsed as help information (by default, `@usage` `@arguments` `@options` `@example`)
28+
- Support for outputting message texts of multiple color styles (`info`, `comment`, `success`, `warning`, `danger`, `error` ... )
29+
- Commonly used special format information display (`section`, `panel`, `padding`, `helpPanel`, `table`, `tree`, `title`, `list`, `multiList`)
30+
- Rich dynamic information display (`pending/loading`, `pointing`, `spinner`, `counterTxt`, `dynamicText`, `progressTxt`, `progressBar`)
31+
- Common user information interaction support (`select`, `multiSelect`, `confirm`, `ask/question`, `askPassword/askHiddenInput`)
32+
- Support for predefined parameter definitions like `symfony/console` (giving parameter values by position, recommended when strict parameter restrictions are required)
33+
- The color output is `windows` `linux` `mac` compatible. Environments that do not support color will automatically remove the relevant CODE.
34+
- Quickly generate auto-completion scripts for the current application in the `bash/zsh` environment
35+
- NEW: Support start an interactive shell for run application
36+
37+
### Built-in tools
38+
39+
- Built-in Phar packaging tool class, which can be easily packaged into `phar` files. Easy to distribute and use
40+
- Run the command `php examples/app phar:pack` in the example, which will package this console library into an `app.phar`
41+
- Built-in file download tool class under command line with progress bar display
42+
- Command line php code highlighting support (from `jakub-onderka/php-console-highlighter` and making some adjustments)
43+
- Simple Terminal screen, cursor control operation class
44+
- Simple process operations using classes (fork, run, stop, wait ..., etc.)
45+
46+
> All features, effects; can be run in the example code `phps/app` in `examples/`. Basically covers all the features and can be tested directly
47+
48+
## Installation
49+
50+
```bash
51+
composer require inhere/console
52+
```
53+
54+
## Document List
55+
56+
> Please go to WIKI for detailed usage documentation
57+
58+
- **[Document Home](https://github.com/inhere/php-console/wiki/home)**
59+
- **[Feature Overview](https://github.com/inhere/php-console/wiki/overview)**
60+
- **[Install](https://github.com/inhere/php-console/wiki/install)**
61+
- **[Create Application](https://github.com/inhere/php-console/wiki/quick-start)**
62+
- **[Add Command](https://github.com/inhere/php-console/wiki/add-command)**
63+
- **[Add Command Group](https://github.com/inhere/php-console/wiki/add-group)**
64+
- **[Register Command](https://github.com/inhere/php-console/wiki/register-command)**
65+
- **[Error/Exception Capture](https://github.com/inhere/php-console/wiki/error-handle)**
66+
- **[Input Object](https://github.com/inhere/php-console/wiki/input-instance)**
67+
- **[output object](https://github.com/inhere/php-console/wiki/output-instance)**
68+
- **[Formatted Output](https://github.com/inhere/php-console/wiki/format-output)**
69+
- **[Progress Dynamic Output](https://github.com/inhere/php-console/wiki/process-output)**
70+
- **[User Interaction](https://github.com/inhere/php-console/wiki/user-interactive)**
71+
- **[Extension Tools](https://github.com/inhere/php-console/wiki/extra-tools)**
72+
73+
## Project address
74+
75+
- **github** https://github.com/inhere/php-console.git
76+
- **gitee** https://gitee.com/inhere/php-console.git
77+
78+
## Unit test
79+
80+
```bash
81+
phpunit
82+
// output coverage without xdebug
83+
phpdbg -dauto_globals_jit=Off -qrr /usr/local/bin/phpunit --coverage-text
84+
```
85+
86+
## Debuging
87+
88+
You can set debug level by ENV `CONSOLE_DEBUG=level`, global option `--debug level`
89+
90+
```bash
91+
# by ENV
92+
$ CONSOLE_DEBUG=4 php examples/app
93+
$ CONSOLE_DEBUG=5 php examples/app
94+
# by global options
95+
$ php examples/app --debug 4
96+
```
97+
98+
## Project use
99+
100+
Check out these projects, which use https://github.com/inhere/php-console :
101+
102+
- [kite](https://github.com/inhere/kite) Kite is a tool for help development.
103+
- More, please see [github used by](https://github.com/inhere/php-console/network/dependents?package_id=UGFja2FnZS01NDI5NzMxOTI%3D)
104+
105+
## License
106+
107+
[MIT](LICENSE)
108+
109+
## My projects
110+
111+
- [inhere/php-validate](https://github.com/inhere/php-validate) A compact and full-featured php verification library
112+
- [inhere/sroute](https://github.com/inhere/php-srouter) Lightweight and fast HTTP request routing library

README.md

+54-57
Original file line numberDiff line numberDiff line change
@@ -5,87 +5,83 @@
55
[![Latest Stable Version](http://img.shields.io/packagist/v/inhere/console.svg)](https://packagist.org/packages/inhere/console)
66
[![Github Actions Status](https://github.com/inhere/php-console/workflows/Unit-tests/badge.svg)](https://github.com/inhere/php-console/actions)
77

8-
Full-featured php command line application library.
8+
简洁、功能全面的php命令行应用库。提供控制台参数解析, 命令运行,颜色风格输出, 用户信息交互, 特殊格式信息显示。
99

10-
Provide console parameter parsing, command run, color style output, user information interaction, and special format information display.
10+
> **[EN README](./README.md)**
1111
12-
> **[中文README](./README.zh-CN.md)**
13-
14-
## Command line preview
12+
## 命令行预览
1513

1614
![app-command-list](https://raw.githubusercontent.com/inhere/php-console/3.x/docs/screenshots/app-command-list.png)
1715

18-
## Features
16+
## 功能概览
1917

20-
> Easy to use. Can be easily integrated into any existing project.
18+
> 使用方便简单。可以方便的整合到任何已有项目中。
2119
22-
- Command line application, `controller`, `command` parsing run on the command line
23-
- Support for setting aliases for commands. A command can have multiple aliases.
24-
- Support command display/hide, enable/disable.
25-
- Full-featured command line option parameter parsing (named parameters, short options `-s`, long options `--long`).
26-
- The `input`, `output` of the command line, management, use
27-
- Command method comments are automatically parsed as help information (by default, `@usage` `@arguments` `@options` `@example`)
28-
- Support for outputting message texts of multiple color styles (`info`, `comment`, `success`, `warning`, `danger`, `error` ... )
29-
- Commonly used special format information display (`section`, `panel`, `padding`, `helpPanel`, `table`, `tree`, `title`, `list`, `multiList`)
30-
- Rich dynamic information display (`pending/loading`, `pointing`, `spinner`, `counterTxt`, `dynamicText`, `progressTxt`, `progressBar`)
31-
- Common user information interaction support (`select`, `multiSelect`, `confirm`, `ask/question`, `askPassword/askHiddenInput`)
32-
- Support for predefined parameter definitions like `symfony/console` (giving parameter values by position, recommended when strict parameter restrictions are required)
33-
- The color output is `windows` `linux` `mac` compatible. Environments that do not support color will automatically remove the relevant CODE.
34-
- Quickly generate auto-completion scripts for the current application in the `bash/zsh` environment
35-
- NEW: Support start an interactive shell for run application
20+
- 命令行应用, 命令行的 `controller`, `command` 解析运行
21+
- 支持给命令设置别名,一个命令可以有多个别名。支持命令的显示/隐藏,启用/禁用
22+
- 功能全面的命令行的选项参数解析(命名参数,短选项 `-s`,长选项 `--long`)
23+
- 命令行下的 输入`input`, 输出 `output` 管理、使用
24+
- 命令方法注释自动解析为帮助信息(默认提取 `@usage` `@arguments` `@options` `@example` 等信息)
25+
- 支持输出多种颜色风格的消息文本(`info`, `comment`, `success`, `warning`, `danger`, `error` ... )
26+
- 常用的特殊格式信息显示(`section`, `panel`, `padding`, `helpPanel`, `table`, `tree`, `title`, `list`, `multiList`)
27+
- 丰富的动态信息显示(`pending/loading`, `pointing`, `spinner`, `counterTxt`, `dynamicText`, `progressTxt`, `progressBar`)
28+
- 常用的用户信息交互支持(`select`, `multiSelect`, `confirm`, `ask/question`, `askPassword/askHiddenInput`)
29+
- 支持类似 `symfony/console` 的预定义参数定义(按位置赋予参数值, 需要严格限制参数选项时推荐使用)
30+
- 颜色输出是 `windows` `linux` `mac` 兼容的,不支持颜色的环境会自动去除相关CODE
31+
- 快速的为当前应用生成 `bash/zsh` 环境下的自动补全脚本
3632

37-
### Built-in tools
33+
### 内置工具
3834

39-
- Built-in Phar packaging tool class, which can be easily packaged into `phar` files. Easy to distribute and use
40-
- Run the command `php examples/app phar:pack` in the example, which will package this console library into an `app.phar`
41-
- Built-in file download tool class under command line with progress bar display
42-
- Command line php code highlighting support (from `jakub-onderka/php-console-highlighter` and making some adjustments)
43-
- Simple Terminal screen, cursor control operation class
44-
- Simple process operations using classes (fork, run, stop, wait ..., etc.)
35+
- 内置Phar打包工具类,可以方便的将应用打包成`phar`文件。方便分发和使用
36+
- 运行示例中的命令 `php examples/app phar:pack`,会将此console库打包成一个`app.phar`
37+
- 内置了命令行下的文件下载工具类,带有进度条显示
38+
- 命令行的php代码高亮支持(来自于`jakub-onderka/php-console-highlighter`并做了一些调整)
39+
- 简单的Terminal屏幕、光标控制操作类
40+
- 简单的进程操作使用类(fork,run,stop,wait ... 等)
4541

46-
> All features, effects; can be run in the example code `phps/app` in `examples/`. Basically covers all the features and can be tested directly
42+
> 所有的特性,效果;都可以运行 `examples/` 中的示例代码 `php examples/app` 展示出来的。基本上涵盖了所有功能,可以直接测试运行
4743
48-
## Installation
44+
## 快速安装
4945

5046
```bash
5147
composer require inhere/console
5248
```
5349

54-
## Document List
50+
## 文档列表
5551

56-
> Please go to WIKI for detailed usage documentation
52+
> 请到WIKI查看详细的使用文档
5753
58-
- **[Document Home](https://github.com/inhere/php-console/wiki/home)**
59-
- **[Feature Overview](https://github.com/inhere/php-console/wiki/overview)**
60-
- **[Install](https://github.com/inhere/php-console/wiki/install)**
61-
- **[Create Application](https://github.com/inhere/php-console/wiki/quick-start)**
62-
- **[Add Command](https://github.com/inhere/php-console/wiki/add-command)**
63-
- **[Add Command Group](https://github.com/inhere/php-console/wiki/add-group)**
64-
- **[Register Command](https://github.com/inhere/php-console/wiki/register-command)**
65-
- **[Error/Exception Capture](https://github.com/inhere/php-console/wiki/error-handle)**
66-
- **[Input Object](https://github.com/inhere/php-console/wiki/input-instance)**
67-
- **[output object](https://github.com/inhere/php-console/wiki/output-instance)**
68-
- **[Formatted Output](https://github.com/inhere/php-console/wiki/format-output)**
69-
- **[Progress Dynamic Output](https://github.com/inhere/php-console/wiki/process-output)**
70-
- **[User Interaction](https://github.com/inhere/php-console/wiki/user-interactive)**
71-
- **[Extension Tools](https://github.com/inhere/php-console/wiki/extra-tools)**
54+
- **[文档首页](https://github.com/inhere/php-console/wiki/home)**
55+
- **[功能概览](https://github.com/inhere/php-console/wiki/overview)**
56+
- **[安装](https://github.com/inhere/php-console/wiki/install)**
57+
- **[创建应用](https://github.com/inhere/php-console/wiki/quick-start)**
58+
- **[添加命令](https://github.com/inhere/php-console/wiki/add-command)**
59+
- **[添加命令组](https://github.com/inhere/php-console/wiki/add-group)**
60+
- **[注册命令](https://github.com/inhere/php-console/wiki/register-command)**
61+
- **[错误/异常捕获](https://github.com/inhere/php-console/wiki/error-handle)**
62+
- **[输入对象](https://github.com/inhere/php-console/wiki/input-instance)**
63+
- **[输出对象](https://github.com/inhere/php-console/wiki/output-instance)**
64+
- **[格式化输出](https://github.com/inhere/php-console/wiki/format-output)** `section`, `panel`, `padding`, `helpPanel`, `table`, `tree`, `title`, `list`, `multiList` 等风格信息输出
65+
- **[进度动态输出](https://github.com/inhere/php-console/wiki/process-output)** 动态信息显示(`pending/loading`, `pointing`, `spinner`, `counterTxt`, `dynamicText`, `progressTxt`, `progressBar`)
66+
- **[用户交互](https://github.com/inhere/php-console/wiki/user-interactive)** 用户信息交互支持(`select`, `multiSelect`, `confirm`, `ask/question`, `askPassword/askHiddenInput`)
67+
- **[扩展工具](https://github.com/inhere/php-console/wiki/extra-tools)** 打包phar, 命令行下的文件下载, 命令行的php代码高亮
7268

73-
## Project address
69+
## 项目地址
7470

7571
- **github** https://github.com/inhere/php-console.git
7672
- **gitee** https://gitee.com/inhere/php-console.git
7773

78-
## Unit test
74+
## 单元测试
7975

8076
```bash
8177
phpunit
82-
// output coverage without xdebug
78+
// 没有xdebug时输出覆盖率
8379
phpdbg -dauto_globals_jit=Off -qrr /usr/local/bin/phpunit --coverage-text
8480
```
8581

86-
## Debuging
82+
## 开发调试
8783

88-
You can set debug level by ENV `CONSOLE_DEBUG=level`, global option `--debug level`
84+
你可以通过环境变量 `CONSOLE_DEBUG=level`, 全局选项 `--debug level` 设置debug级别
8985

9086
```bash
9187
# by ENV
@@ -95,18 +91,19 @@ $ CONSOLE_DEBUG=5 php examples/app
9591
$ php examples/app --debug 4
9692
```
9793

98-
## Project use
94+
## 使用console的项目
9995

100-
Check out these projects, which use https://github.com/inhere/php-console :
96+
看看这些使用了 https://github.com/inhere/php-console 的项目:
10197

102-
- [kite](https://github.com/inhere/kite) Kite is a tool for help development.
98+
- [kite](https://github.com/inhere/kite) PHP编写的,方便本地开发和使用的个人CLI工具应用
10399
- More, please see [github used by](https://github.com/inhere/php-console/network/dependents?package_id=UGFja2FnZS01NDI5NzMxOTI%3D)
104100

105101
## License
106102

107103
[MIT](LICENSE)
108104

109-
## My projects
105+
## 我的其他项目
106+
107+
- [inhere/php-validate](https://github.com/inhere/php-validate) 一个简洁小巧且功能完善的php验证库
108+
- [inhere/sroute](https://github.com/inhere/php-srouter) 轻量且快速的HTTP请求路由库
110109

111-
- [inhere/php-validate](https://github.com/inhere/php-validate) A compact and full-featured php verification library
112-
- [inhere/sroute](https://github.com/inhere/php-srouter) Lightweight and fast HTTP request routing library

0 commit comments

Comments
 (0)