From 94d3b16a70011fbf5d1206bb43f54a624c274919 Mon Sep 17 00:00:00 2001 From: Elvand Lie Nababan Date: Sun, 15 Nov 2026 18:30:51 +0700 Subject: [PATCH] docs: correct the help, version and instantiate behavior in the CLI pages The --help and --version options still parse the other arguments, so an unknown option or invalid value is an error, and instantiate runs the module's start function. Signed-off-by: Elvand Lie Nababan --- docs/start/build-and-run/cli.md | 4 ++-- docs/start/build-and-run/instantiate.md | 2 +- .../current/start/build-and-run/cli.md | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/start/build-and-run/cli.md b/docs/start/build-and-run/cli.md index 1a50c37a..86febeab 100644 --- a/docs/start/build-and-run/cli.md +++ b/docs/start/build-and-run/cli.md @@ -56,8 +56,8 @@ The `wasmedge` CLI tool will execute the wasm file in interpreter mode by defaul The options of the `wasmedge` CLI tool are as follows: -1. `-v|--version`: Show the version information. Will ignore other arguments below. -2. `-h|--help`: Show the help messages. Will ignore other arguments below. +1. `-v|--version`: Show the version information and exit without running a program; other arguments are still checked, so an unknown option or an invalid value is reported as an error. +2. `-h|--help`: Show the help messages and exit without running a program; other arguments are still checked, so an unknown option or an invalid value is reported as an error. 3. _(Optional)_ `--reactor`: Enable the reactor mode. - In the reactor mode, `wasmedge` runs a specified function exported by the WebAssembly program. - WasmEdge will execute the function whose name should be given in `ARG[0]`. diff --git a/docs/start/build-and-run/instantiate.md b/docs/start/build-and-run/instantiate.md index 3e77fca7..16365913 100644 --- a/docs/start/build-and-run/instantiate.md +++ b/docs/start/build-and-run/instantiate.md @@ -6,7 +6,7 @@ sidebar_position: 7 After [installation](https://wasmedge.org/docs/start/install#install), users can execute the `wasmedge instantiate` command. -The `wasmedge instantiate` command loads, validates, and instantiates a WebAssembly module. It checks that all imports can be resolved and that the module can be fully instantiated, but does **not** execute any functions. This is useful for verifying that a WASM module can be successfully linked and instantiated in a given environment before running it. +The `wasmedge instantiate` command loads, validates, and instantiates a WebAssembly module. It checks that all imports can be resolved and that the module can be fully instantiated, but does **not** call any exported function. If the module has a start function, it runs as part of instantiation, and a trap in it makes the command fail. This is useful for verifying that a WASM module can be successfully linked and instantiated in a given environment before running it. The `wasmedge instantiate` command also supports linking additional WASM modules, allowing you to verify that multi-module dependencies resolve correctly. diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/start/build-and-run/cli.md b/i18n/zh/docusaurus-plugin-content-docs/current/start/build-and-run/cli.md index fe4a0624..826507b0 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/start/build-and-run/cli.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/start/build-and-run/cli.md @@ -39,8 +39,8 @@ USAGE `wasmedge` 命令行工具的选项如下: -1. `-v|--version`:显示版本信息。将忽略下面的其他参数。 -2. `-h|--help`:显示帮助信息。将忽略下面的其他参数。 +1. `-v|--version`:显示版本信息并退出,不运行程序;其他参数仍会被检查,未知选项或无效值会报告为错误。 +2. `-h|--help`:显示帮助信息并退出,不运行程序;其他参数仍会被检查,未知选项或无效值会报告为错误。 3. (可选)`--reactor`:启用反应器模式。 - 在反应器模式下,`wasmedge` 运行 WebAssembly 程序中导出的特定函数。 - WasmEdge 将执行函数,函数名应作为 `ARG[0]` 给出。