Langtool: Add --dry-run support

This commit is contained in:
Henrik Rydgård committed 2022-11-29 09:57:18 +01:00
1 parent 6ef855bf31
commit 3ba37f4e77
1 file changed
+8 -2
+8 -2
View File
@@ -11,6 +11,8 @@ use structopt::StructOpt;
struct Opt {
#[structopt(subcommand)]
cmd: Command,
#[structopt(short, long)]
dry_run: bool,
}
#[derive(StructOpt, Debug)]
@@ -170,7 +172,9 @@ fn main() {
}
}
target_ini.write().unwrap();
if !opt.dry_run {
target_ini.write().unwrap();
}
}
println!("Langtool processing {}", reference_ini_filename);
@@ -199,5 +203,7 @@ fn main() {
_ => {}
}
// println!("{:#?}", target_ini);
if !opt.dry_run {
reference_ini.write().unwrap();
}
}