diff --git a/src/args.rs b/src/args.rs index 28781b7..3fb7c73 100644 --- a/src/args.rs +++ b/src/args.rs @@ -132,6 +132,8 @@ pub struct ImportArgs { #[arg(long)] /// Replacement table file pub replacement_json: Option, + #[arg(long, action = ArgAction::SetTrue)] + pub warn_when_output_file_not_found: bool, } #[derive(Subcommand, Debug)] diff --git a/src/main.rs b/src/main.rs index 993459c..e4611c2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -650,11 +650,13 @@ pub fn import_script( if !out_path.exists() { out_path = std::path::PathBuf::from(&odir).join(f.name()); if !out_path.exists() { - eprintln!( - "Warning: File {} does not exist, using file from original archive.", - out_path.display() - ); - COUNTER.inc_warning(); + if imp_cfg.warn_when_output_file_not_found { + eprintln!( + "Warning: File {} does not exist, using file from original archive.", + out_path.display() + ); + COUNTER.inc_warning(); + } match writer.write_all(f.data()) { Ok(_) => {} Err(e) => {