Skip to content

Commit

Permalink
chore(cli): modify version & verbose options short flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Red-Asuka committed Jul 20, 2022
1 parent 24d4575 commit b0d6a63
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cli/README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ mqttx --help

| 参数 | 描述 |
| ------------- | ---------------------------- |
| -V, --version | 输出当前 MQTT X CLI 的版本号 |
| -v, --version | 输出当前 MQTT X CLI 的版本号 |
| -h, --help | 展示 mqttx 命令的帮助信息 |

| 命令 | 描述 |
Expand Down Expand Up @@ -145,7 +145,7 @@ mqttx sub --help
| --will-message <BODY> | 遗嘱消息的 payload |
| --will-qos <0/1/2> | 遗嘱消息的 QoS |
| --will-retain | 遗嘱消息的 retain 标志位 |
| -v, --verbose | 在接收到的 Payload 前显示当前 Topic |
| -vb, --verbose | 在接收到的 Payload 前显示当前 Topic |
| --help | 展示 sub 命令的帮助信息 |

#### 发布
Expand Down
8 changes: 4 additions & 4 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ mqttx --help

| Options | Description |
| ------------- | ------------------------- |
| -V, --version | output the version number |
| -v, --version | output the version number |
| -h, --help | display help for command |

| Command | Description |
Expand All @@ -124,7 +124,7 @@ mqttx --help
mqttx sub --help
```

| Options | Description |
| Options | Description |
| ---------------------- | ------------------------------------------------------------ |
| -h, --hostname <HOST> | the broker host (default: "localhost") |
| -p, --port <PORT> | the broker port |
Expand All @@ -144,7 +144,7 @@ mqttx sub --help
| --will-message <BODY> | the will message |
| --will-qos <0/1/2> | the will qos |
| --will-retain | send a will retained message (default: false) |
| -v, --verbose | print the topic before the message |
| -vb, --verbose | print the topic before the message |
| --help | display help for sub command |

#### Publish
Expand All @@ -153,7 +153,7 @@ mqttx sub --help
mqttx pub --help
```

| Options | Description |
| Options | Description |
| ---------------------- | --------------------------------------------------- |
| -h, --hostname <HOST> | the broker host |
| -p, --port <PORT> | the broker port |
Expand Down
4 changes: 2 additions & 2 deletions cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class Commander {
}

init(): void {
this.program.name('mqttx').description('An MQTT client for the command line').version(version)
this.program.name('mqttx').description('An MQTT client for the command line').version(version, '-v, --version')

this.program
.command('pub')
Expand Down Expand Up @@ -61,7 +61,7 @@ export class Commander {
.option('--will-message <BODY>', 'the will message')
.option('--will-qos <0/1/2>', 'the will qos', parseNumber)
.option('--will-retain', 'send a will retained message', false)
.option('-v, --verbose', 'print the topic before the message')
.option('-vb, --verbose', 'print the topic before the message')
.action(sub)
}
}
Expand Down

0 comments on commit b0d6a63

Please sign in to comment.