| 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)] |
| 340 | enum AnalysisProfileArg { |
| 341 | /// Reduced analysis, for faster large-scale runs |
| 342 | Light, |
| 343 | /// Best readability and semantic recovery |
| 344 | Balanced, |
| 345 | } |
| 346 | |
| 347 | impl 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)] |
| 357 | enum 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 | |
| 369 | impl 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)] |