()
| 1 | use std::process::Command; |
| 2 | |
| 3 | fn 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 | } |