use std::{ io::{self, Write}, process::Command, }; pub fn parse_line(line: &str) -> io::Result<()> { let tokens = line.trim().split(' ').collect::>(); let mut args: &[&str] = &[]; let command = tokens[0]; if !args.is_empty() { args = &tokens[1..]; } let mut command = Command::new(command); command.args(args); let output = command.output()?; io::stderr().write_all(&output.stderr)?; io::stdout().write_all(&output.stdout)?; Ok(()) }