static void Main(string[] args)
        {
            ProcessOptions(args);

            var driver = new FogBugzDriver(url, token);

            try
            {
                driver.ConnectAsync().Wait();
            } catch (Exception ex) {
                Console.WriteLine("Unable to connect to FogBugz");
                if (verbose)
                {
                    Console.WriteLine(ex);
                }
                Environment.Exit(1);
            }

            var tasks = new List <Task>(ticketsFiles.Count());

            foreach (var ticketsFile in ticketsFiles)
            {
                Console.WriteLine($"Processing {ticketsFile}");
                string sourceDir = Path.GetDirectoryName(ticketsFile);
                string mediaDir  = Path.Combine(sourceDir, "media");

                var importer = new Importer(driver, ticketsFile, mediaDir);
                tasks.Add(importer.ImportAsync());
            }
            Task.WaitAll(tasks.ToArray());
        }
 public Importer(FogBugzDriver driver, string caseFile, string attachmentDirectory)
 {
     this.driver              = driver;
     this.caseFile            = caseFile;
     this.attachmentDirectory = attachmentDirectory;
 }