Skip to content

Commit

Permalink
Fixed up some issues with the "wasmer run" detection logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-F-Bryan committed Jun 16, 2023
1 parent b3bfc7b commit e3abe19
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ fn wasmer_main_inner() -> Result<(), anyhow::Error> {
args.execute()
}
Err(e) => {
if e.kind() == clap::error::ErrorKind::InvalidSubcommand {
let might_be_wasmer_run = matches!(
e.kind(),
clap::error::ErrorKind::InvalidSubcommand | clap::error::ErrorKind::UnknownArgument
);

if might_be_wasmer_run {
if let Ok(run) = Run::try_parse() {
// Try to parse the command using the `wasmer some/package`
// shorthand. Note that this has discoverability issues
Expand Down

0 comments on commit e3abe19

Please sign in to comment.