Skip to main content

es_fluent_cli/commands/
dry_run.rs

1use crate::utils::ui;
2
3#[derive(Clone, Debug)]
4pub struct DryRunDiff {
5    before: String,
6    after: String,
7}
8
9impl DryRunDiff {
10    pub fn new(before: String, after: String) -> Self {
11        Self { before, after }
12    }
13
14    pub fn print(&self) {
15        ui::print_diff(&self.before, &self.after);
16    }
17}
18
19#[derive(Clone, Copy, Debug)]
20pub enum DryRunSummary {
21    Format { formatted: usize },
22    Sync { keys: usize, locales: usize },
23}
24
25impl DryRunSummary {
26    pub fn print(self) {
27        match self {
28            DryRunSummary::Format { formatted } => {
29                ui::print_format_dry_run_summary(formatted);
30            },
31            DryRunSummary::Sync { keys, locales } => {
32                ui::print_sync_dry_run_summary(keys, locales);
33            },
34        }
35    }
36}