1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

tests: add UCommand::env()

This commit is contained in:
Michael Gehring 2016-01-03 14:16:12 +01:00
parent dae64b5277
commit 830ca8c04d

View file

@ -311,6 +311,15 @@ impl UCommand {
self.raw.args(args.as_ref());
Box::new(self)
}
pub fn env<K, V>(&mut self, key: K, val: V) -> Box<&mut UCommand> where K: AsRef<OsStr>, V: AsRef<OsStr> {
if self.has_run {
panic!(ALREADY_RUN);
}
self.raw.env(key, val);
Box::new(self)
}
pub fn run(&mut self) -> CmdResult {
self.has_run = true;
log_info("run", &self.comm_string);