lib/bisu.rb in bisu-1.5.0 vs lib/bisu.rb in bisu-1.6.0
- old
+ new
@@ -30,11 +30,15 @@
localize_file(localizer, locale, language, options[:default_language], in_path, out_path)
end
end
- Bisu::Logger.print_summary
+ Logger.print_summary
+
+ if options[:strict] && Logger.summary[:warn] > 0
+ Logger.error("Found a warning while in strict mode")
+ end
end
private
def dictionary_for(config:, options:)
@@ -88,9 +92,13 @@
opts_hash[:from_file_path] = file
end
opts.on("--save-dictionary PATH", "Save downloaded dictionary locally at given path") do |path|
opts_hash[:dictionary_save_path] = path
+ end
+
+ opts.on("-s", "--strict", "Fail in the presence of any warning") do
+ opts_hash[:strict] = true
end
opts.on_tail("-h", "--help", "Show this message") do
puts opts
exit