diff options
Diffstat (limited to 'src/builder.rs')
-rw-r--r-- | src/builder.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/builder.rs b/src/builder.rs index 4b80e57..c13dca6 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -458,6 +458,7 @@ impl ExecContainerOptionsBuilder { ExecContainerOptionsBuilder { params: HashMap::new() } } + /// Command to run, as an array of strings pub fn cmd(&mut self, cmds: Vec<&str>) -> &mut ExecContainerOptionsBuilder { for cmd in cmds { self.params.entry("Cmd").or_insert(Vec::new()).push(cmd.to_owned()); @@ -465,6 +466,14 @@ impl ExecContainerOptionsBuilder { self } + /// A list of environment variables in the form "VAR=value" + pub fn env(&mut self, envs: Vec<&str>) -> &mut ExecContainerOptionsBuilder { + for env in envs { + self.params.entry("Env").or_insert(Vec::new()).push(env.to_owned()); + } + self + } + pub fn build(&self) -> ExecContainerOptions { ExecContainerOptions { params: self.params.clone() } } |