Implement the allow-unknown-exports option for the run command.
This commit implements the `--allow-unknown-exports` option to the CLI run command that will ignore unknown exports in a command module rather than return an error. Fixes #2587.
This commit is contained in:
@@ -81,6 +81,10 @@ pub struct RunCommand {
|
||||
#[structopt(flatten)]
|
||||
common: CommonOptions,
|
||||
|
||||
/// Allow unknown exports when running commands.
|
||||
#[structopt(long = "allow-unknown-exports")]
|
||||
allow_unknown_exports: bool,
|
||||
|
||||
/// Grant access to the given host directory
|
||||
#[structopt(long = "dir", number_of_values = 1, value_name = "DIRECTORY")]
|
||||
dirs: Vec<String>,
|
||||
@@ -146,6 +150,8 @@ impl RunCommand {
|
||||
let argv = self.compute_argv();
|
||||
|
||||
let mut linker = Linker::new(&store);
|
||||
linker.allow_unknown_exports(self.allow_unknown_exports);
|
||||
|
||||
populate_with_wasi(
|
||||
&mut linker,
|
||||
preopen_dirs,
|
||||
|
||||
Reference in New Issue
Block a user