#[macro_export] macro_rules! task { ($verse:expr, $out:expr) => { if $verse.couplet { let mut child = Command::new($verse.verb()) .args($verse.clause()) .stdin(Stdio::piped()) .spawn()?; let stdin = child.stdin.as_mut().ok_or(io::ErrorKind::BrokenPipe)?; stdin.write_all(&$out.as_bytes())?; $out.clear(); child } else { Command::new($verse.verb()).args($verse.clause()).spawn()? } }; } #[macro_export()] macro_rules! ctask { ($verse:expr, $out:expr) => { if $verse.couplet { let mut child = Command::new($verse.verb()) .args($verse.clause()) .stdin(Stdio::piped()) .stdout(Stdio::piped()) .spawn()?; let stdin = child.stdin.as_mut().ok_or(io::ErrorKind::BrokenPipe)?; stdin.write_all(&$out.as_bytes())?; $out.clear(); child } else { Command::new($verse.verb()) .args($verse.clause()) .stdout(Stdio::piped()) .spawn()? } }; }