add helper method to AppContext to simplify getting options

This commit is contained in:
theubusu
2026-02-22 20:14:04 +01:00
parent 3989710c70
commit a6567ae532
9 changed files with 16 additions and 21 deletions
+1 -2
View File
@@ -27,7 +27,6 @@ pub fn is_msd11_file(app_ctx: &AppContext) -> Result<Option<Box<dyn Any>>, Box<d
pub fn extract_msd11(app_ctx: &AppContext, _ctx: Box<dyn Any>) -> Result<(), Box<dyn std::error::Error>> {
let mut file = app_ctx.file().ok_or("Extractor expected file")?;
let print_ouith_tree = app_ctx.options.iter().any(|e| e == "msd:print_ouith");
let header: FileHeader = file.read_le()?;
println!("\nNumber of sections: {}", header.section_count);
@@ -82,7 +81,7 @@ pub fn extract_msd11(app_ctx: &AppContext, _ctx: Box<dyn Any>) -> Result<(), Box
let toc = decrypt_aes_salted_tizen(&toc_data, &passphrase_bytes)?;
opt_dump_dec_hdr(app_ctx, &toc, "toc")?;
let (items, info) = parse_blob_1_9(&toc, print_ouith_tree)?;
let (items, info) = parse_blob_1_9(&toc, app_ctx.has_option("msd:print_ouith"))?;
if let Some(info) = info {
println!("\nImage info:\n{} {}.{}",