Skip to content

Commit

Permalink
fixup! build!: move cargo run -p run-wasm to cargo xtask run-wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler committed Jun 8, 2023
1 parent e961753 commit f97e6c2
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions xtask/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,16 @@ pub(crate) enum Subcommand {

impl Subcommand {
fn parse(mut args: Arguments) -> anyhow::Result<Subcommand> {
args.subcommand()
.context("failed to parse subcommand")
.and_then(|parsed| match parsed.as_deref() {
None => bail!("no subcommand specified; see `--help` for more details"),
Some("run-wasm") => Ok(Self::RunWasm { args }),
Some(other) => {
bail!("unrecognized subcommand {other:?}; see `--help` for more details")
}
})
match args
.subcommand()
.context("failed to parse subcommand")?
.as_deref()
.context("no subcommand specified; see `--help` for more details")?
{
"run-wasm" => Ok(Self::RunWasm { args }),
other => {
bail!("unrecognized subcommand {other:?}; see `--help` for more details")
}
}
}
}

0 comments on commit f97e6c2

Please sign in to comment.