Replace WebAssembly feature CLI options with --wasm-features.

This commit hides the existing WebAssembly feature CLI options (e.g.
`--enable-simd`) and adds a `--wasm-features` flag that enables multiple
(or all) WebAssembly features.

Features can be disabled by prefixing the value with `-`, e.g.
`--wasm-features=-simd`.
This commit is contained in:
Peter Huene
2021-03-30 23:56:56 -07:00
parent 1ce2a87149
commit 0000aa0646
9 changed files with 356 additions and 58 deletions

View File

@@ -68,9 +68,15 @@ fn parse_preloads(s: &str) -> Result<(String, PathBuf)> {
Ok((parts[0].into(), parts[1].into()))
}
lazy_static::lazy_static! {
static ref AFTER_HELP: String = {
crate::WASM_FEATURES.to_string()
};
}
/// Runs a WebAssembly module
#[derive(StructOpt)]
#[structopt(name = "run", setting = AppSettings::TrailingVarArg)]
#[structopt(name = "run", setting = AppSettings::TrailingVarArg, after_help = AFTER_HELP.as_str())]
pub struct RunCommand {
#[structopt(flatten)]
common: CommonOptions,