MCPcopy Create free account
hub / github.com/caverav/flutterdec / handle_diff

Function handle_diff

crates/flutterdec-cli/src/main.rs:322–376  ·  view source on GitHub ↗
(repo_root: &Path, cmd: DiffCmd)

Source from the content-addressed store, hash-verified

320 #[arg(long, value_enum, default_value_t = FunctionScopeArg::AppUnknown, value_name = "SCOPE")]
321 function_scope: FunctionScopeArg,
322 /// Restrict the compare set to this Dart package (repeatable)
323 #[arg(long = "app-package", value_name = "NAME")]
324 app_packages: Vec<String>,
325 /// Which snapshot adapter backend to use
326 #[arg(long, value_enum, default_value_t = AdapterBackendArg::Auto, value_name = "BACKEND")]
327 adapter_backend: AdapterBackendArg,
328 /// Wall-clock deadline for one adapter invocation, in seconds
329 #[arg(long, value_name = "SECONDS")]
330 adapter_timeout: Option<u64>,
331 /// Fail if either side has an adapter/loader snapshot hash mismatch
332 #[arg(long)]
333 require_snapshot_hash_match: bool,
334 /// Print the diff summary as JSON on stdout
335 #[arg(long)]
336 json: bool,
337}
338
339#[derive(Clone, Copy, Debug, ValueEnum)]
340enum AnalysisProfileArg {
341 /// Reduced analysis, for faster large-scale runs
342 Light,
343 /// Best readability and semantic recovery
344 Balanced,
345}
346
347impl AnalysisProfileArg {
348 fn to_core(self) -> DecompileAnalysisProfile {
349 match self {
350 Self::Light => DecompileAnalysisProfile::Light,
351 Self::Balanced => DecompileAnalysisProfile::Balanced,
352 }
353 }
354}
355
356#[derive(Clone, Copy, Debug, ValueEnum)]
357enum FunctionScopeArg {
358 /// App (package:*) plus functions of unknown ownership
359 #[value(name = "app-unknown")]
360 AppUnknown,
361 /// Only app (package:*) functions
362 #[value(name = "app")]
363 App,
364 /// Also include Flutter, Dart runtime, and framework internals
365 #[value(name = "all")]
366 All,
367}
368
369impl FunctionScopeArg {
370 fn to_core(self) -> FunctionScope {
371 match self {
372 Self::AppUnknown => FunctionScope::AppUnknown,
373 Self::App => FunctionScope::App,
374 Self::All => FunctionScope::All,
375 }
376 }
377}
378
379#[derive(Clone, Copy, Debug, ValueEnum)]

Callers 1

mainFunction · 0.85

Calls 2

run_diffFunction · 0.85
to_coreMethod · 0.80

Tested by

no test coverage detected