#!/usr/bin/env ruby require_relative '../lib/interactive_brokers_2_tasty_works' if ARGV[0].nil? || ARGV[1].nil? || ARGV[0].include?('--help') || ARGV[0].include?('-?') puts "\nUsage: ./ib2tw /path/to/input.xml /path/to/output.csv\n\n" exit 1 end input_file = File.expand_path(ARGV[0]) output_file = File.expand_path(ARGV[1]) unless File.exists?(input_file) puts "\nFile not found: #{input_file}\n\n" exit 1 end puts "\n" puts "Input: #{input_file}" puts "Output: #{output_file}\n" puts "Converting..." InteractiveBrokers2TastyWorks.new(input_path: input_file).save_as(output_file) puts "Done!"