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

Merge remote-tracking branch 'origin/master' into mktemp

This commit is contained in:
Sunrin SHIMURA (keen) 2016-01-04 01:58:38 +09:00
commit 0d4e67929b

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);