diff --git a/lib/i18n/tasks/cli.rb b/lib/i18n/tasks/cli.rb index bc97a0af..0fd76373 100644 --- a/lib/i18n/tasks/cli.rb +++ b/lib/i18n/tasks/cli.rb @@ -36,11 +36,12 @@ def start(argv) def run(argv) argv.each_with_index do |arg, i| if ['--config', '-c'].include?(arg) - if File.exist?(argv[i + 1]) - @config_file = argv[i + 1] + _, config_file = argv.slice!(i, 2) + if File.exist?(config_file) + @config_file = config_file break else - error "Config file doesn't exist: #{argv[i + 1]}", 128 + error "Config file doesn't exist: #{config_file}", 128 end end end