Skip to content

Commit aa6dc49

Browse files
committed
feat!(cli-nats): use import and export flags
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
1 parent 4538c78 commit aa6dc49

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ We will use the following two Rust wRPC applications using [NATS.io] transport:
186186
2. Serve Wasm `hello` server via [NATS.io]
187187

188188
```sh
189-
wrpc-wasmtime nats serve rust rust ./target/wasm32-wasip1/release/hello_component_server.wasm
189+
wrpc-wasmtime nats serve --export rust ./target/wasm32-wasip1/release/hello_component_server.wasm
190190
```
191191

192192
- Sample output:
@@ -197,7 +197,7 @@ We will use the following two Rust wRPC applications using [NATS.io] transport:
197197
3. Call Wasm `hello` server using a Wasm `hello` client via [NATS.io]:
198198

199199
```sh
200-
wrpc-wasmtime nats run rust ./target/wasm32-wasip1/release/hello-component-client.wasm
200+
wrpc-wasmtime nats run --import rust ./target/wasm32-wasip1/release/hello-component-client.wasm
201201
```
202202

203203
- Sample output in the client:
@@ -231,7 +231,7 @@ We will use the following two Rust wRPC applications using [NATS.io] transport:
231231
7. Call native wRPC `hello` server using Wasm `hello` client via [NATS.io]:
232232

233233
```sh
234-
wrpc-wasmtime nats run native ./target/wasm32-wasip1/release/hello-component-client.wasm
234+
wrpc-wasmtime nats run --import native ./target/wasm32-wasip1/release/hello-component-client.wasm
235235
```
236236

237237
## Repository structure

crates/wasmtime-cli/src/nats.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub struct RunArgs {
2323
timeout: humantime::Duration,
2424

2525
/// Prefix to send import invocations to
26+
#[arg(long, default_value = "")]
2627
import: String,
2728

2829
/// Path or URL to Wasm command component
@@ -45,9 +46,11 @@ pub struct ServeArgs {
4546
group: Option<String>,
4647

4748
/// Prefix to send import invocations to
49+
#[arg(long, default_value = "")]
4850
import: String,
4951

5052
/// Prefix to listen for export invocations on
53+
#[arg(long, default_value = "")]
5154
export: String,
5255

5356
/// Path or URL to Wasm command component

0 commit comments

Comments
 (0)