Skip to content

Commit

Permalink
docs(cli): modify cli readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Red-Asuka authored and ysfscream committed Sep 19, 2022
1 parent c9df237 commit bbd7841
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions cli/README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ mqttx conn --help
| -k, --keepalive <SEC> | MQTT 的 Keep Alive,默认为 30 |
| -u, --username <USER> | 连接到 MQTT Broker 的用户名 |
| -P, --password <PASS> | 连接到 MQTT Broker 的密码 |
| -l, --protocol <PROTO> | 连接时的协议,mqtt 或 mqtts |
| -l, --protocol <PROTO> | 连接时的协议,mqtt 或 mqtts,默认为 mqtt |
| --key <PATH> | key 文件的路径 |
| --cert <PATH> | cert 文件的路径 |
| --ca | ca 证书的文件路径 |
Expand Down Expand Up @@ -181,7 +181,7 @@ mqttx sub --help
| -k, --keepalive <SEC> | MQTT 的 Keep Alive,默认为 30 |
| -u, --username <USER> | 连接到 MQTT Broker 的用户名 |
| -P, --password <PASS> | 连接到 MQTT Broker 的密码 |
| -l, --protocol <PROTO> | 连接时的协议,mqtt 或 mqtts |
| -l, --protocol <PROTO> | 连接时的协议,mqtt 或 mqtts,默认为 mqtt |
| -nl, --no_local | MQTT 5.0 订阅选项中的 no local 标识 |
| -rap, --retain-as-published | MQTT 5.0 订阅选项中的 retain as published 标识 |
| -rh, --retain-handling <0/1/2> | MQTT 5.0 订阅选项中的 retain handling 标识 |
Expand Down Expand Up @@ -217,7 +217,7 @@ mqttx pub --help
| -M, --multiline | 可以通过多行发布多条消息 |
| -u, --username <USER> | 连接到 MQTT Broker 的用户名 |
| -P, --password <PASS> | 连接到 MQTT Broker 的密码 |
| -l, --protocol <PROTO> | 连接时的协议,mqtt 或 mqtts |
| -l, --protocol <PROTO> | 连接时的协议,mqtt 或 mqtts,默认为 mqtt |
| --key <PATH> | key 文件的路径 |
| --cert <PATH> | cert 文件的路径 |
| --ca | ca 证书的文件路径 |
Expand Down
6 changes: 3 additions & 3 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ mqttx conn --help
| -k, --keepalive <SEC> | send a ping every SEC seconds (default: 30) |
| -u, --username <USER> | the username |
| -P, --password <PASS> | the password |
| -l, --protocol <PROTO> | the protocol to use, mqtt or mqtts |
| -l, --protocol <PROTO> | the protocol to use, mqtt or mqtts (default: mqtt) |
| --key <PATH> | path to the key file |
| --cert <PATH> | path to the cert file |
| --ca <PATH> | path to the ca certificate |
Expand Down Expand Up @@ -180,7 +180,7 @@ mqttx sub --help
| -k, --keepalive <SEC> | send a ping every SEC seconds (default: 30) |
| -u, --username <USER> | the username |
| -P, --password <PASS> | the password |
| -l, --protocol <PROTO> | the protocol to use, mqtt or mqtts |
| -l, --protocol <PROTO> | the protocol to use, mqtt or mqtts (default: mqtt) |
| -nl, --no_local | the no local MQTT 5.0 flag |
| -rap, --retain-as-published | the retain as published MQTT 5.0 flag |
| -rh, --retain-handling <0/1/2> | the retain handling MQTT 5.0 |
Expand Down Expand Up @@ -216,7 +216,7 @@ mqttx pub --help
| -M, --multiline | read lines from stdin as multiple messages |
| -u, --username <USER> | the username |
| -P, --password <PASS> | the password |
| -l, --protocol <PROTO> | the protocol to use, mqtt or mqtts |
| -l, --protocol <PROTO> | the protocol to use, mqtt or mqtts (default: mqtt) |
| --key <PATH> | path to the key file |
| --cert <PATH> | path to the cert file |
| --ca | path to the ca certificate |
Expand Down
6 changes: 3 additions & 3 deletions cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class Commander {
.option('-k, --keepalive <SEC>', 'send a ping every SEC seconds', parseNumber, 30)
.option('-u, --username <USER>', 'the username')
.option('-P, --password <PASS>', 'the password')
.option('-l, --protocol <PROTO>', 'the protocol to use, mqtt or mqtts', parseProtocol)
.option('-l, --protocol <PROTO>', 'the protocol to use, mqtt or mqtts (default: mqtt)', parseProtocol)
.option('--key <PATH>', 'path to the key file')
.option('--cert <PATH>', 'path to the cert file')
.option('--ca <PATH>', 'path to the ca certificate')
Expand Down Expand Up @@ -69,7 +69,7 @@ export class Commander {
.option('-M, --multiline', 'read lines from stdin as multiple messages')
.option('-u, --username <USER>', 'the username')
.option('-P, --password <PASS>', 'the password')
.option('-l, --protocol <PROTO>', 'the protocol to use, mqtt or mqtts', parseProtocol)
.option('-l, --protocol <PROTO>', 'the protocol to use, mqtt or mqtts (default: mqtt)', parseProtocol)
.option('--key <PATH>', 'path to the key file')
.option('--cert <PATH>', 'path to the cert file')
.option('--ca <PATH>', 'path to the ca certificate')
Expand Down Expand Up @@ -98,7 +98,7 @@ export class Commander {
.option('-k, --keepalive <SEC>', 'send a ping every SEC seconds', parseNumber, 30)
.option('-u, --username <USER>', 'the username')
.option('-P, --password <PASS>', 'the password')
.option('-l, --protocol <PROTO>', 'the protocol to use, mqtt or mqtts', parseProtocol)
.option('-l, --protocol <PROTO>', 'the protocol to use, mqtt or mqtts (default: mqtt)', parseProtocol)
.option('-nl, --no_local [FLAG...]', 'the no local MQTT 5.0 flag', parseVariadicOfBooleanType)
.option(
'-rap, --retain-as-published [FLAG...]',
Expand Down
2 changes: 1 addition & 1 deletion cli/src/utils/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const parseNumber = (value: string) => {

const parseProtocol = (value: string) => {
if (!['mqtt', 'mqtts'].includes(value)) {
program.error('Only support mqtt and mqtts.')
program.error('Only mqtt and mqtts are supported.')
}
return value
}
Expand Down

0 comments on commit bbd7841

Please sign in to comment.