Skip to content

Commit

Permalink
Fix parsing of new subcommands (#7398)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
alexcrichton committed Oct 30, 2023
1 parent 196e90d commit c57d458
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/old_cli.rs
Expand Up @@ -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()),
Expand Down

0 comments on commit c57d458

Please sign in to comment.