| 376 | } |
| 377 | } |
| 378 | |
| 379 | #[derive(Clone, Copy, Debug, ValueEnum)] |
| 380 | enum AdapterBackendArg { |
| 381 | /// Try r2flutter, then the Blutter bridge, then the internal adapter |
| 382 | Auto, |
| 383 | /// Force the internal adapter |
| 384 | Internal, |
| 385 | /// Require the Blutter bridge, with no fallback |
| 386 | Blutter, |
| 387 | // Clap's derive spells this value `r2-flutter`; the alias accepts the tool's own |
| 388 | // spelling, which is what the docs, `report.json` and the env vars all use. |
| 389 | /// Require the r2flutter backend, with no fallback |
| 390 | #[value(alias = "r2flutter")] |
| 391 | R2Flutter, |
| 392 | } |
| 393 | |
| 394 | impl AdapterBackendArg { |
| 395 | fn to_core(self) -> AdapterBackend { |
| 396 | match self { |
| 397 | Self::Auto => AdapterBackend::Auto, |
| 398 | Self::Internal => AdapterBackend::Internal, |
| 399 | Self::Blutter => AdapterBackend::Blutter, |
| 400 | Self::R2Flutter => AdapterBackend::R2Flutter, |
| 401 | } |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | #[derive(Args, Debug)] |
| 406 | struct EngineFingerprintCmd { |
| 407 | /// Engine ELF to fingerprint, usually libflutter.so |
| 408 | #[arg(value_name = "INPUT")] |
| 409 | input: PathBuf, |
| 410 | /// Directory to write the fingerprint report into |
| 411 | #[arg(short = 'o', long = "out", value_name = "DIR")] |
| 412 | out_dir: Option<PathBuf>, |
| 413 | /// Maximum number of version markers to report |
| 414 | #[arg(long, default_value_t = 24, value_name = "N")] |
| 415 | max_markers: usize, |
| 416 | /// Print the fingerprint as JSON on stdout |
| 417 | #[arg(long)] |