bin/rvpacker-txt in rvpacker-txt-1.9.3 vs bin/rvpacker-txt in rvpacker-txt-1.9.4
- old
+ new
@@ -19,13 +19,15 @@
disable_custom_processing: false,
romanize: false,
logging: false,
force: false,
append: false,
- shuffle_level: 0 }
+ shuffle_level: 0,
+ silent: false }
options[:action] = ARGV[0]
+ options[:silent] = true unless ARGV.delete('--silent').nil?
unless %w[read write].include?(options[:action])
if %w[-h --help].include?(options[:action])
options[:action] = 'none'
elsif options[:action].nil?
@@ -122,15 +124,17 @@
raise 'Allowed values: 0, 1, 2.' if num > 2
options[:shuffle_level] = num
end
end
- cmd.on('-l', '--log', 'Enables logging.') do
+ cmd.on('-l', '--log',
+ 'Enables logging.') do
options[:logging] = true
end
- cmd.on('-h', '--help', "Prints the program's help message or for the entered subcommand.") do
+ cmd.on('-h', '--help',
+ "Prints the program's help message or for the entered subcommand.") do
puts cmd
exit
end
end.parse!
@@ -164,10 +168,11 @@
force = options[:force]
# @type [Boolean]
append = options[:append]
# @type [Boolean]
romanize = options[:romanize]
+silent = options[:silent]
extensions = { xp: 'rxdata', vx: 'rvdata', ace: 'rvdata2' }
original_directory = Dir.glob(File.join(input_path, '{data,original}'), File::FNM_CASEFOLD).first
raise '"Data" or "original" directory not found within input directory.' unless original_directory
@@ -213,17 +218,19 @@
if options[:action] == 'read'
require 'read'
processing_mode = if force
- wait_time_start = Time.now
+ unless options[:silent]
+ wait_time_start = Time.now
- puts "WARNING! You're about to forcefully rewrite all your translation files, including _trans files.",
- "If you really want to do it, make sure you've made a backup of your _trans files, if you made some changes in them already.",
- "Input 'Y' to continue."
- exit unless $stdin.gets.chomp == 'Y'
+ puts "WARNING! You're about to forcefully rewrite all your translation files, including _trans files.",
+ "If you really want to do it, make sure you've made a backup of your _trans files, if you made some changes in them already.",
+ "Input 'Y' to continue."
+ exit unless $stdin.gets.chomp == 'Y'
- $wait_time += Time.now - wait_time_start
+ $wait_time += Time.now - wait_time_start
+ end
:force
elsif append
:append
else
:default