From 7006cc075d70eb2fe9dd4dde8023bd879b86a724 Mon Sep 17 00:00:00 2001 From: YuShifan <894402575bt@gmail.com> Date: Wed, 17 May 2023 14:46:27 +0800 Subject: [PATCH] docs(cli): update ls command --- cli/README-CN.md | 43 ++++++++++++++++++++++++++++++++++++++----- cli/README.md | 39 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 74 insertions(+), 8 deletions(-) diff --git a/cli/README-CN.md b/cli/README-CN.md index beeaba133..d28fb3b23 100644 --- a/cli/README-CN.md +++ b/cli/README-CN.md @@ -143,6 +143,9 @@ mqttx simulate -sc tesla -c 10 # Specify a scenario file and start the simulation mqttx simulate -f -c 10 + +# List the built-in scenarios +mqttx ls -sc ``` ### 参数介绍 @@ -165,7 +168,7 @@ mqttx --help | bench | MQTT 性能测试 | | simulate | MQTT 模拟器 | -#### 连接 +### 连接 ```shell mqttx conn --help @@ -210,7 +213,7 @@ mqttx conn --help | --config \[PATH\] | 从本地配置文件加载参数,文件支持 json 和 yaml 格式,默认路径为 ./mqttx-cli-config.json | | --help | 展示 conn 命令的帮助信息 | -#### 订阅 +### 订阅 ```shell mqttx sub --help @@ -265,7 +268,7 @@ mqttx sub --help | --config \[PATH\] | 从本地配置文件加载参数,文件支持 json 和 yaml 格式,默认路径为 ./mqttx-cli-config.json | | --help | 展示 sub 命令的帮助信息 | -#### 发布 +### 发布 ```shell mqttx pub --help @@ -325,7 +328,7 @@ mqttx pub --help ### 性能测试 -性能测试命令与普通命令参数基本相同,以下仅列出新增或有变化的参数 +性能测试命令与普通命令参数基本相同,以下仅列出新增或有变化的参数。 #### 连接性能测试 @@ -374,7 +377,7 @@ mqttx bench pub --help 用于模拟特定场景下 MQTT 发布消息操作。 -模拟器命令与[发布性能测试](#发布性能测试)参数基本相同,以下仅列出新增或有变化的参数 +模拟器命令与[发布性能测试](#发布性能测试)参数基本相同,以下仅列出新增或有变化的参数。 ```shell mqttx simulate --help @@ -417,6 +420,36 @@ module.exports = { 对于更多示例和详细的编辑指南,请参考 MQTTX GitHub 仓库中的[脚本示例](https://github.com/emqx/MQTTX/tree/main/scripts-example/IoT-data-scenarios),或查看如何使用 [faker.js](https://fakerjs.dev/) 来生成各种类型的随机数据。 +### 列表 + +`list` 命令提供了可用资源的概览。 + +> 目前,该命令仅支持列出内置的场景。 + +```shell +mqttx list --help +``` + +| 参数 | 描述 | +| ----------------------------- | -------------------------------- | +| -sc, --scenarios | 列出内置的场景 | + +#### 内置场景 + +可以使用 `--scenarios` 选项来显示内置场景的列表。 + +```shell +mqttx list --scenarios +``` + +这个命令会输出一个表格,显示每个内置场景的名称和描述。如果想在模拟命令中使用其中一个,只需在 `--scenario` 选项中指定场景名称: + +```shell +mqttx simulate --scenario +``` + +未来,`list` 命令将添加更多选项和功能。敬请期待! + ## 与 EMQX 更好的合作 MQTTX 为连接测试 EMQX 等 MQTT 消息服务器而生,一键式的连接方式和简洁的图形界面可以帮助您快速连接到 EMQX 或 EMQX Cloud 调试并探索其功能特性。 diff --git a/cli/README.md b/cli/README.md index 2152f073b..96d19d368 100644 --- a/cli/README.md +++ b/cli/README.md @@ -140,6 +140,9 @@ mqttx simulate -sc tesla -c 10 # Specify a scenario file and start the simulation mqttx simulate -f -c 10 + +# List the built-in scenarios +mqttx ls -sc ``` ### Help @@ -162,7 +165,7 @@ mqttx --help | bench | MQTT Benchmark in performance testing | | simulate | Simulate publishing scenario-specific MQTT messages | -#### Connect +### Connect ```shell mqttx conn --help @@ -207,7 +210,7 @@ mqttx conn --help | --config \[PATH\] | load the parameters from the local configuration file, which supports json and yaml format, default path is `./mqttx-cli-config.json` | | --help | display help for conn command | -#### Subscribe +### Subscribe ```shell mqttx sub --help @@ -262,7 +265,7 @@ mqttx sub --help | --config \[PATH\] | load the parameters from the local configuration file, which supports json and yaml format, default path is `./mqttx-cli-config.json` | | --help | display help for sub command | -#### Publish +### Publish ```shell mqttx pub --help @@ -412,6 +415,36 @@ module.exports = { For more examples and detailed editing guides, please refer to the [scripts-example](https://github.com/emqx/MQTTX/tree/main/scripts-example/IoT-data-scenarios) in the MQTTX GitHub repository, or see how to use [faker.js](https://fakerjs.dev/) to generate various types of random data. +### List + +The `list` command provides an overview of available resources. + +> Currently, it supports listing built-in scenarios. + +```shell +mqttx list --help +``` + +| Options | Description | +| ----------------------------- | -------------------------------- | +| -sc, --scenarios | list the built-in scenarios | + +#### Built-in Scenarios + +You can use the `--scenarios` option to display a list of built-in scenarios. + +```shell +mqttx list --scenarios +``` + +This command will output a table that shows the name and description of each built-in scenario. If you want to use one of them in the simulate command, simply specify the scenario name in the `--scenario` option: + +```shell +mqttx simulate --scenario +``` + +More options and features will be added to the `list` command in the future. Stay tuned! + ## Better Together with EMQX MQTTX is designed to connect to test MQTT Brokers such as EMQX, The one-click connection and simple graphical interface make it easy to connect to EMQX or EMQX Cloud to debug and explore functional features.