File tree Expand file tree Collapse file tree 10 files changed +19
-6
lines changed
Expand file tree Collapse file tree 10 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,13 @@ jobs:
1313 strategy :
1414 fail-fast : true
1515 matrix :
16- php : [8.0 ]
16+ php : [8.1 ]
1717
1818 steps :
1919 - name : Checkout
2020 uses : actions/checkout@v3
21+ with :
22+ fetch-depth : 0
2123
2224 - name : Set ENV for github-release
2325 # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
4850 id : changelog
4951 run : |
5052 wget -c -q https://github.com/inhere/kite/releases/latest/download/kite.phar
51- php kite.phar git cl prev last --style gh-release --no-merges --fetch-tags --unshallow -- file changelog.md
53+ php kite.phar git cl prev last --style gh-release --no-merges --fetch-tags --file changelog.md
5254 cat changelog.md
5355
5456 # https://github.com/softprops/action-gh-release
Original file line number Diff line number Diff line change @@ -37,6 +37,11 @@ Generic PHP command line flags parse library
3737- Support binding named arguemnt
3838- Support define array argument
3939
40+ ### Quick build command
41+
42+ - Use ` Toolkit\PFlag\CliCmd ` to quickly build a simple command application
43+ - Use ` Toolkit\PFlag\CliApp ` to quickly build a command application that supports subcommands
44+
4045## Install
4146
4247- Require PHP 8.0+
Original file line number Diff line number Diff line change 3838- 支持绑定命名参数
3939- 支持定义数组参数
4040
41+ ### 快速构建命令
42+
43+ - 使用 ` Toolkit\PFlag\CliCmd ` 可以快速的构建一个简单的命令应用
44+ - 使用 ` Toolkit\PFlag\CliApp ` 可以快速的构建一个支持子命令的命令应用
45+
4146## 安装
4247
4348- Require PHP 8.0+
Original file line number Diff line number Diff line change 1616
1717// run demo:
1818// php example/cliapp.php
19-
19+ // php example/cliapp.php test2 -h
2020$ cli = CliApp::newWith (static function (CliApp $ app ): void {
2121 $ app ->setName ('myApp ' );
2222 $ app ->setDesc ('my cli application. v1.0.1 ' );
Original file line number Diff line number Diff line change 1414require dirname (__DIR__ ) . '/test/bootstrap.php ' ;
1515
1616// run demo:
17- // php example/clicmd.php
17+ // php example/clicmd.php -h
1818// php example/clicmd.php --name inhere value1
1919// php example/clicmd.php --age 23 --name inhere value1
2020
Original file line number Diff line number Diff line change 1919require dirname (__DIR__ ) . '/test/bootstrap.php ' ;
2020
2121// run demo:
22- // php example/flag -demo.php -h
23- // php example/sflags -demo.php --name inhere --age 99 --tag go -t php -t java -f arg0 arr0 arr1
22+ // php example/flags -demo.php -h
23+ // php example/flags -demo.php --name inhere --age 99 --tag go -t php -t java -f arg0 arr0 arr1
2424$ flags = $ _SERVER ['argv ' ];
2525// NOTICE: must shift first element.
2626$ scriptFile = array_shift ($ flags );
Original file line number Diff line number Diff line change 1515require dirname (__DIR__ ) . '/test/bootstrap.php ' ;
1616
1717// run demo:
18+ // php example/sflags-demo.php -h
1819// php example/sflags-demo.php --name inhere --age 99 --tag go -t php -t java -f arg0 arr0 arr1
1920$ flags = $ _SERVER ['argv ' ];
2021// NOTICE: must shift first element.
You can’t perform that action at this time.
0 commit comments