Add the ability to write to a separate strings DB.

This commit is contained in:
Sebastian Celis 2012-02-10 17:16:58 -06:00
parent 9d905e449f
commit ee629a0aaf
2 changed files with 8 additions and 3 deletions

View file

@ -56,6 +56,9 @@ module Twine
opts.on('-a', '--all', 'Normally, when consuming a string file, Twine will ignore any string keys that do not exist in your master file. This flag will force those missing strings to be added to your master file.') do |a|
@options[:consume_all] = true
end
opts.on('-o', '--output-file OUTPUT_FILE', 'Write the new strings database to this file instead of replacing the original file. This flag is only useful when running the consume-string-file or consume-loc-drop commands.') do |o|
@options[:output_path] = o
end
opts.on('-h', '--help', 'Show this message.') do |h|
puts opts.help
exit

View file

@ -81,7 +81,8 @@ module Twine
end
read_write_string_file(@options[:input_path], true, lang)
@strings.write(@options[:strings_file])
output_path = @options[:output_path] || @options[:strings_file]
@strings.write(output_path)
end
def read_write_string_file(path, is_read, lang)
@ -172,8 +173,9 @@ module Twine
end
end
end
@strings.write @options[:strings_file]
output_path = @options[:output_path] || @options[:strings_file]
@strings.write(output_path)
end
def generate_report