MCPcopy Index your code
hub / github.com/explodingcamera/tinywasm / run_cli

Function run_cli

crates/cli/src/lib.rs:15–34  ·  view source on GitHub ↗
(cli: Cli)

Source from the content-addressed store, hash-verified

13pub use cli::{Cli, Commands};
14
15pub fn run_cli(cli: Cli) -> Result<()> {
16 match cli.command {
17 Some(Commands::Run(args)) => cmd::run::run(args),
18 Some(Commands::Compile(args)) => cmd::compile::run(args),
19 Some(Commands::Dump(args)) => cmd::dump::run(args),
20 Some(Commands::Inspect(args)) => cmd::inspect::run(args),
21 #[cfg(feature = "wast")]
22 Some(Commands::Wast(args)) => cmd::wast::run(args),
23 Some(Commands::Completion(args)) => cmd::completion::run(args),
24 None => match cli.run.module.as_deref() {
25 Some(_) => cmd::run::run(cli.run),
26 None => {
27 let mut cmd = Cli::command();
28 cmd.print_help()?;
29 println!();
30 Ok(())
31 }
32 },
33 }
34}

Callers 1

mainFunction · 0.85

Calls 1

runFunction · 0.50

Tested by

no test coverage detected