sara_core/diff/
options.rs1use std::path::PathBuf;
4
5#[derive(Debug, Clone)]
7pub struct DiffOptions {
8 pub ref1: String,
10 pub ref2: String,
12 pub repositories: Vec<PathBuf>,
14 pub stat: bool,
16}
17
18impl DiffOptions {
19 pub fn new(ref1: impl Into<String>, ref2: impl Into<String>) -> Self {
21 Self {
22 ref1: ref1.into(),
23 ref2: ref2.into(),
24 repositories: Vec::new(),
25 stat: false,
26 }
27 }
28
29 pub fn with_repositories(mut self, repositories: Vec<PathBuf>) -> Self {
31 self.repositories = repositories;
32 self
33 }
34
35 pub fn add_repository(mut self, path: PathBuf) -> Self {
37 self.repositories.push(path);
38 self
39 }
40
41 pub fn with_stat(mut self, stat: bool) -> Self {
43 self.stat = stat;
44 self
45 }
46}