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 d042321 commit 4b7c86d
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 4b7c86d

Please sign in to comment.