1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use std::{path::Path, process::Command};
pub struct KeyToPublicCommand {
    command: Command,
}

impl KeyToPublicCommand {
    pub fn new(command: Command) -> Self {
        Self { command }
    }

    pub fn input<P: AsRef<Path>>(mut self, input: P) -> Self {
        self.command.arg("--input").arg(input.as_ref());
        self
    }

    pub fn output<P: AsRef<Path>>(mut self, output: P) -> Self {
        self.command.arg(output.as_ref());
        self
    }

    pub fn build(self) -> Command {
        self.command
    }
}