(
args: &Args,
output: &Utf8PlatformPath,
target_path: Option<&Utf8PlatformPath>,
base_path: Option<&Utf8PlatformPath>,
unit_options: Option<ProjectOptions>,
)
| 176 | } |
| 177 | |
| 178 | fn run_oneshot( |
| 179 | args: &Args, |
| 180 | output: &Utf8PlatformPath, |
| 181 | target_path: Option<&Utf8PlatformPath>, |
| 182 | base_path: Option<&Utf8PlatformPath>, |
| 183 | unit_options: Option<ProjectOptions>, |
| 184 | ) -> Result<()> { |
| 185 | let output_format = OutputFormat::from_option(args.format.as_deref())?; |
| 186 | let (diff_config, mapping_config) = build_config_from_args(args, None, unit_options.as_ref())?; |
| 187 | let target = target_path |
| 188 | .map(|p| { |
| 189 | obj::read::read(p.as_ref(), &diff_config, DiffSide::Target) |
| 190 | .with_context(|| format!("Loading {p}")) |
| 191 | }) |
| 192 | .transpose()?; |
| 193 | let base = base_path |
| 194 | .map(|p| { |
| 195 | obj::read::read(p.as_ref(), &diff_config, DiffSide::Base) |
| 196 | .with_context(|| format!("Loading {p}")) |
| 197 | }) |
| 198 | .transpose()?; |
| 199 | let result = |
| 200 | diff::diff_objs(target.as_ref(), base.as_ref(), None, &diff_config, &mapping_config)?; |
| 201 | let left = target.as_ref().zip(result.left.as_ref()); |
| 202 | let right = base.as_ref().zip(result.right.as_ref()); |
| 203 | let diff_result = DiffResult::new(left, right, &diff_config)?; |
| 204 | write_output(&diff_result, Some(output), output_format)?; |
| 205 | Ok(()) |
| 206 | } |
| 207 | |
| 208 | fn build_config_from_args( |
| 209 | args: &Args, |
no test coverage detected