Disable output file not found warning by default

This commit is contained in:
2025-06-10 11:27:04 +08:00
parent dac8aaae85
commit d67d1d617e
2 changed files with 9 additions and 5 deletions

View File

@@ -132,6 +132,8 @@ pub struct ImportArgs {
#[arg(long)]
/// Replacement table file
pub replacement_json: Option<String>,
#[arg(long, action = ArgAction::SetTrue)]
pub warn_when_output_file_not_found: bool,
}
#[derive(Subcommand, Debug)]

View File

@@ -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) => {