Browse Source

Fix parsing of new subcommands (#7398)

This commit updates the parsing of the old CLI to understand new
subcommands to ensure that `wasmtime serve foo.wasm` isn't mistakenly
interpreted in the old CLI as executing the module `serve` with the
argument `foo.wasm`.

Closes #7396
pull/7421/head
Alex Crichton 1 year ago
committed by GitHub
parent
commit
c57d45849a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/old_cli.rs

3
src/old_cli.rs

@ -234,7 +234,8 @@ pub struct RunCommand {
fn parse_module(s: OsString) -> anyhow::Result<PathBuf> {
// Do not accept wasmtime subcommand names as the module name
match s.to_str() {
Some("help") | Some("run") | Some("compile") => {
Some("help") | Some("run") | Some("compile") | Some("serve") | Some("explore")
| Some("settings") | Some("wast") | Some("config") => {
bail!("module name cannot be the same as a subcommand")
}
_ => Ok(s.into()),

Loading…
Cancel
Save