Skip to content

Commit

Permalink
Update CLI docs for wit-bindgen (bytecodealliance#970)
Browse files Browse the repository at this point in the history
Modernize documentation for `wit` and `--world` options.

cc bytecodealliance#790
  • Loading branch information
alexcrichton authored Jun 7, 2024
1 parent 25fed4e commit 76c5401
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/bin/wit-bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,24 @@ struct Common {
#[clap(long = "out-dir")]
out_dir: Option<PathBuf>,

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

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

Expand Down

0 comments on commit 76c5401

Please sign in to comment.