Ajout : module command_builder
This commit is contained in:
parent
48f25feb6a
commit
bf92de25b6
1 changed files with 23 additions and 0 deletions
23
src/command/command_builder.rs
Normal file
23
src/command/command_builder.rs
Normal file
|
@ -0,0 +1,23 @@
|
|||
use super::unix_program::UnixProgram;
|
||||
use super::Command;
|
||||
|
||||
pub struct CommandBuilder {
|
||||
argv: Vec<String>,
|
||||
}
|
||||
|
||||
impl CommandBuilder {
|
||||
pub fn new() -> Self {
|
||||
Self { argv: Vec::new() }
|
||||
}
|
||||
|
||||
pub fn argv(&mut self, argv: Vec<String>) -> &Self {
|
||||
self.argv = argv;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn build(&self) -> impl Command {
|
||||
let command = UnixProgram::new(&self.argv);
|
||||
|
||||
command
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue