bin/i18n-tasks in i18n-tasks-0.7.1 vs bin/i18n-tasks in i18n-tasks-0.7.2
- old
+ new
@@ -20,24 +20,26 @@
end
exit exit_code
}
begin
- ran = false
+ ran = false
commander = ::I18n::Tasks::Commands
+ instance = commander.new
+ instance.set_internal_locale!
slop_adapter = ::I18n::Tasks::SlopCommand
- args = ARGV.dup
- args = ['--help'] if args.empty?
+ args = ARGV.dup
+ args = ['--help'] if args.empty?
Slop.parse(args, help: true) do
on('-v', '--version', 'Print the version') {
puts I18n::Tasks::VERSION
exit
}
commander.cmds.each do |name, attr|
- slop_dsl = slop_adapter.slop_command(name, attr) { |name, opts, args|
+ slop_dsl = slop_adapter.slop_command(name, attr) { |name, opts|
begin
ran = true
- commander.run_command name, slop_adapter.parse_slop_opts_args(opts, args)
+ instance.safe_run name, opts
rescue Errno::EPIPE
# ignore Errno::EPIPE which is throw when pipe breaks, e.g.:
# i18n-tasks missing | head
exit 1
end