Ajout : module command_builder

This commit is contained in:
Ahurac 2024-04-11 19:07:12 +02:00
parent 48f25feb6a
commit bf92de25b6

View 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
}
}