mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-06-07 05:18:44 +08:00
Disable output file not found warning by default
This commit is contained in:
@@ -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)]
|
||||
|
||||
12
src/main.rs
12
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) => {
|
||||
|
||||
Reference in New Issue
Block a user