MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / main

Function main

crates/memtrack/testdata/spawn_wrapper/src/bin/wrapper.rs:3–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1use std::process::Command;
2
3fn main() {
4 let args: Vec<String> = std::env::args().skip(1).collect();
5 if args.is_empty() {
6 eprintln!("Usage: wrapper <command> [args...]");
7 std::process::exit(1);
8 }
9
10 let mut child = Command::new(&args[0])
11 .args(&args[1..])
12 .spawn()
13 .expect("Failed to spawn child process");
14
15 let status = child.wait().expect("Failed to wait for child");
16 std::process::exit(status.code().unwrap_or(1));
17}

Callers

nothing calls this directly

Calls 2

argsMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected