mirror of
https://github.com/Ap0dexMe0/unixtract.git
synced 2026-07-16 05:04:22 +02:00
add helper method to AppContext to simplify getting options
This commit is contained in:
@@ -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{} {}.{}",
|
||||
|
||||
Reference in New Issue
Block a user