1
Fork 0

Add Cc::output method

This commit is contained in:
Guillaume Gomez 2024-05-30 16:31:59 +02:00
parent dcc9a8f283
commit b0d0cc6590

View file

@ -80,6 +80,13 @@ impl Cc {
self
}
/// Specify path of the output binary.
pub fn output<P: AsRef<Path>>(&mut self, path: P) -> &mut Self {
self.cmd.arg("-o");
self.cmd.arg(path.as_ref());
self
}
/// Get the [`Output`][::std::process::Output] of the finished process.
pub fn command_output(&mut self) -> ::std::process::Output {
self.cmd.output().expect("failed to get output of finished process")