summaryrefslogtreecommitdiff
path: root/subplotlib/src/steplibrary/runcmd.rs
diff options
context:
space:
mode:
Diffstat (limited to 'subplotlib/src/steplibrary/runcmd.rs')
-rw-r--r--subplotlib/src/steplibrary/runcmd.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/subplotlib/src/steplibrary/runcmd.rs b/subplotlib/src/steplibrary/runcmd.rs
index fc93b7e..b90f8b7 100644
--- a/subplotlib/src/steplibrary/runcmd.rs
+++ b/subplotlib/src/steplibrary/runcmd.rs
@@ -8,6 +8,7 @@ pub use crate::prelude::*;
use std::collections::HashMap;
use std::env::{self, JoinPathsError};
use std::ffi::{OsStr, OsString};
+use std::fmt::Debug;
use std::io::Write;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
@@ -27,6 +28,18 @@ pub struct Runcmd {
stderr: Vec<u8>,
}
+impl Debug for Runcmd {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ f.debug_struct("Runcmd")
+ .field("env", &self.env)
+ .field("paths", &self.paths)
+ .field("exitcode", &self.exitcode)
+ .field("stdout", &String::from_utf8_lossy(&self.stdout))
+ .field("stderr", &String::from_utf8_lossy(&self.stderr))
+ .finish()
+ }
+}
+
// Note, this prefix requires that the injection env vars must have
// names which are valid unicode (and ideally ASCII)
const ENV_INJECTION_PREFIX: &str = "SUBPLOT_ENV_";