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:
@@ -120,7 +120,6 @@ fn extract_file(app_ctx: &AppContext, file_reader: &mut Cursor<Vec<u8>>, offset:
|
||||
|
||||
let mut hdr_reader = Cursor::new(dec_header);
|
||||
let mut modules: Vec<ModuleEntry> = Vec::new();
|
||||
let split_main = app_ctx.options.iter().any(|e| e == "pana_dvd:split_main");
|
||||
|
||||
for i in 0..100 {
|
||||
let mut entry: ModuleEntry = hdr_reader.read_le()?;
|
||||
@@ -154,7 +153,7 @@ fn extract_file(app_ctx: &AppContext, file_reader: &mut Cursor<Vec<u8>>, offset:
|
||||
if module.name() == "MAIN" {
|
||||
println!("- Extracting MAIN...");
|
||||
extract_main(file_reader, key, &output_path)?;
|
||||
if split_main {
|
||||
if app_ctx.has_option("pana_dvd:split_main") {
|
||||
println!("\n- Splitting MAIN...");
|
||||
split_main_file(&output_path, output_folder)?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user