add shorthand for command line parameter in pake-cli
This commit is contained in:
11
bin/README.md
vendored
11
bin/README.md
vendored
@@ -60,8 +60,11 @@ url 为你需要打包的网页链接 🔗,必须提供。
|
||||
|
||||
```shell
|
||||
--name <value>
|
||||
# 或者
|
||||
-n <value>
|
||||
```
|
||||
|
||||
|
||||
#### [icon]
|
||||
|
||||
应用 icon,支持本地/远程文件,默认为 Pake 自带图标,定制的可以去 [icon-icons](https://icon-icons.com) 或 [macOSicons](https://macosicons.com/#/) 搜索下载。
|
||||
@@ -72,6 +75,8 @@ url 为你需要打包的网页链接 🔗,必须提供。
|
||||
|
||||
```shell
|
||||
--icon <path>
|
||||
# 或者
|
||||
-i <path>
|
||||
```
|
||||
|
||||
#### [height]
|
||||
@@ -88,6 +93,8 @@ url 为你需要打包的网页链接 🔗,必须提供。
|
||||
|
||||
```shell
|
||||
--width <number>
|
||||
# 或者
|
||||
-w <number>
|
||||
```
|
||||
|
||||
#### [transparent]
|
||||
@@ -96,6 +103,8 @@ url 为你需要打包的网页链接 🔗,必须提供。
|
||||
|
||||
```shell
|
||||
--transparent
|
||||
# 或者
|
||||
-t
|
||||
```
|
||||
|
||||
#### [resize]
|
||||
@@ -112,4 +121,6 @@ url 为你需要打包的网页链接 🔗,必须提供。
|
||||
|
||||
```shell
|
||||
--fullscreen <value>
|
||||
# 或者
|
||||
-f <value>
|
||||
```
|
||||
|
||||
10
bin/README_EN.md
vendored
10
bin/README_EN.md
vendored
@@ -60,6 +60,8 @@ The name of your application. We will prompt you to enter this if you do not pro
|
||||
|
||||
```shell
|
||||
--name <value>
|
||||
# or
|
||||
-n <value>
|
||||
```
|
||||
|
||||
#### [icon]
|
||||
@@ -72,6 +74,8 @@ The application icon. Supports local and remote files. By default, it is the bra
|
||||
|
||||
```shell
|
||||
--icon <path>
|
||||
# or
|
||||
-i <path>
|
||||
```
|
||||
|
||||
#### [height]
|
||||
@@ -88,6 +92,8 @@ The width of the packaged application window. The default is `1200px`.
|
||||
|
||||
```shell
|
||||
--width <number>
|
||||
# or
|
||||
-w <number>
|
||||
```
|
||||
|
||||
#### [transparent]
|
||||
@@ -96,6 +102,8 @@ Whether to enable the immersive header. The default is `false`.
|
||||
|
||||
```shell
|
||||
--transparent
|
||||
# or
|
||||
-t
|
||||
```
|
||||
|
||||
#### [resize]
|
||||
@@ -112,4 +120,6 @@ Indicates if the window should be full screen on application launch. The default
|
||||
|
||||
```shell
|
||||
--fullscreen <value>
|
||||
# or
|
||||
-f <value>
|
||||
```
|
||||
|
||||
12
bin/cli.ts
vendored
12
bin/cli.ts
vendored
@@ -14,14 +14,14 @@ program.version(packageJson.version).description('A cli application can package
|
||||
program
|
||||
.showHelpAfterError()
|
||||
.argument('[url]', 'the web url you want to package', validateUrlInput)
|
||||
.option('--name <string>', 'application name')
|
||||
.option('--icon <string>', 'application icon', DEFAULT_PAKE_OPTIONS.icon)
|
||||
.option('-n, --name <string>', 'application name')
|
||||
.option('-i, --icon <string>', 'application icon', DEFAULT_PAKE_OPTIONS.icon)
|
||||
.option('--height <number>', 'window height', validateNumberInput, DEFAULT_PAKE_OPTIONS.height)
|
||||
.option('--width <number>', 'window width', validateNumberInput, DEFAULT_PAKE_OPTIONS.width)
|
||||
.option('-w, --width <number>', 'window width', validateNumberInput, DEFAULT_PAKE_OPTIONS.width)
|
||||
.option('--no-resizable', 'whether the window can be resizable', DEFAULT_PAKE_OPTIONS.resizable)
|
||||
.option('--fullscreen', 'makes the packaged app start in full screen', DEFAULT_PAKE_OPTIONS.fullscreen)
|
||||
.option('--transparent', 'transparent title bar', DEFAULT_PAKE_OPTIONS.transparent)
|
||||
.option('--debug', 'debug', DEFAULT_PAKE_OPTIONS.transparent)
|
||||
.option('-f, --fullscreen', 'makes the packaged app start in full screen', DEFAULT_PAKE_OPTIONS.fullscreen)
|
||||
.option('-t, --transparent', 'transparent title bar', DEFAULT_PAKE_OPTIONS.transparent)
|
||||
.option('-d, --debug', 'debug', DEFAULT_PAKE_OPTIONS.transparent)
|
||||
.action(async (url: string, options: PakeCliOptions) => {
|
||||
|
||||
await checkUpdateTips();
|
||||
|
||||
12
dist/cli.js
vendored
12
dist/cli.js
vendored
@@ -2256,14 +2256,14 @@ program.version(packageJson.version).description('A cli application can package
|
||||
program
|
||||
.showHelpAfterError()
|
||||
.argument('[url]', 'the web url you want to package', validateUrlInput)
|
||||
.option('--name <string>', 'application name')
|
||||
.option('--icon <string>', 'application icon', DEFAULT_PAKE_OPTIONS.icon)
|
||||
.option('-n, --name <string>', 'application name')
|
||||
.option('-i, --icon <string>', 'application icon', DEFAULT_PAKE_OPTIONS.icon)
|
||||
.option('--height <number>', 'window height', validateNumberInput, DEFAULT_PAKE_OPTIONS.height)
|
||||
.option('--width <number>', 'window width', validateNumberInput, DEFAULT_PAKE_OPTIONS.width)
|
||||
.option('-w, --width <number>', 'window width', validateNumberInput, DEFAULT_PAKE_OPTIONS.width)
|
||||
.option('--no-resizable', 'whether the window can be resizable', DEFAULT_PAKE_OPTIONS.resizable)
|
||||
.option('--fullscreen', 'makes the packaged app start in full screen', DEFAULT_PAKE_OPTIONS.fullscreen)
|
||||
.option('--transparent', 'transparent title bar', DEFAULT_PAKE_OPTIONS.transparent)
|
||||
.option('--debug', 'debug', DEFAULT_PAKE_OPTIONS.transparent)
|
||||
.option('-f, --fullscreen', 'makes the packaged app start in full screen', DEFAULT_PAKE_OPTIONS.fullscreen)
|
||||
.option('-t, --transparent', 'transparent title bar', DEFAULT_PAKE_OPTIONS.transparent)
|
||||
.option('-d, --debug', 'debug', DEFAULT_PAKE_OPTIONS.transparent)
|
||||
.action((url, options) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
yield checkUpdateTips();
|
||||
if (!url) {
|
||||
|
||||
Reference in New Issue
Block a user