mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
commit
d56c29acfe
1 changed files with 9 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue