MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / main

Function main

utils/wasi-cpp-header/src/main.rs:21–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19}
20
21fn main() -> Result<()> {
22 let matches = app_from_crate!()
23 .setting(clap::AppSettings::SubcommandRequiredElseHelp)
24 .subcommand(
25 SubCommand::with_name("generate")
26 .arg(Arg::with_name("inputs").required(true).multiple(true))
27 .arg(
28 Arg::with_name("output")
29 .short("o")
30 .long("output")
31 .takes_value(true)
32 .required(true),
33 ),
34 )
35 .subcommand(
36 SubCommand::with_name("generate-api").about("generate api.hpp from current snapshot"),
37 )
38 .get_matches();
39
40 if let Some(generate) = matches.subcommand_matches("generate") {
41 let inputs = generate
42 .values_of("inputs")
43 .expect("required inputs arg")
44 .collect::<Vec<_>>();
45 let output = generate.value_of("output").expect("required output arg");
46 run(&inputs, &output)?;
47 } else {
48 unreachable!("a subcommand must be provided");
49 }
50
51 Ok(())
52}

Callers

nothing calls this directly

Calls 2

runFunction · 0.85
requiredMethod · 0.80

Tested by

no test coverage detected