Skip to content

Commit 76c5401

Browse files
authored
Update CLI docs for wit-bindgen (#970)
Modernize documentation for `wit` and `--world` options. cc #790
1 parent 25fed4e commit 76c5401

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/bin/wit-bindgen.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,24 @@ struct Common {
7272
#[clap(long = "out-dir")]
7373
out_dir: Option<PathBuf>,
7474

75-
/// WIT document to generate bindings for.
76-
#[clap(value_name = "DOCUMENT", index = 1)]
75+
/// Location of WIT file(s) to generate bindings for.
76+
///
77+
/// This path can be either a directory containing `*.wit` files, a `*.wit`
78+
/// file itself, or a `*.wasm` file which is a wasm-encoded WIT package.
79+
/// Most of the time it's likely to be a directory containing `*.wit` files
80+
/// with an optional `deps` folder inside of it.
81+
#[clap(value_name = "WIT", index = 1)]
7782
wit: PathBuf,
7883

79-
/// World within the WIT document specified to generate bindings for.
84+
/// Optionally specified world that bindings are generated for.
8085
///
81-
/// This can either be `foo` which is the default world in document `foo` or
82-
/// it's `foo.bar` which is the world named `bar` within document `foo`.
86+
/// Bindings are always generated for a world but this option can be omitted
87+
/// when the WIT package pointed to by the `WIT` option only has a single
88+
/// world. If there's more than one world in the package then this option
89+
/// must be specified to name the world that bindings are generated for.
90+
/// This option can also use the fully qualified syntax such as
91+
/// `wasi:http/proxy` to select a world from a dependency of the main WIT
92+
/// package.
8393
#[clap(short, long)]
8494
world: Option<String>,
8595

0 commit comments

Comments
 (0)