private void Convert(Options options)
        {
            var converter = new SvgToVectorDocumentConverter(options.BlankVectorDrawablePath, options.FixFillType);

            foreach (var inputFile in Directory.GetFiles(options.InputDirectory, options.InputMask + ".svg", SearchOption.AllDirectories))
            {
                _outWriter.Write(".");

                var subpath = PathHelper.Subpath(inputFile, options.InputDirectory);
                var tempFile = PathHelper.GenerateTempFileName("svg");

                try
                {
                    SvgPreprocessor.Preprocess(inputFile, tempFile);
                    Inkscape.SimplifySvgSync(options.InkscapeAppPath, tempFile, tempFile);

                    var svgDocument = SvgDocumentWrapper.CreateFromFile(tempFile);
                    var outputDocument = converter.Convert(svgDocument).WrappedDocument;
                    PrintWarnings(subpath, converter.Warnings);

                    var outputFile = Path.Combine(options.OutputDirectory, subpath);
                    outputFile = Path.ChangeExtension(outputFile, "xml");
                    outputFile = PathHelper.NormalizeFileName(outputFile);

                    Directory.CreateDirectory(Path.GetDirectoryName(outputFile));
                    var settings = new XmlWriterSettings
                    {
                        Encoding = new UTF8Encoding(false),
                        Indent = true,
                        IndentChars = new string(' ', 4),
                        NewLineOnAttributes = true
                    };
                    using (var writer = XmlWriter.Create(outputFile, settings))
                    {
                        outputDocument.Save(writer);
                    }
                }
                catch (FixFillTypeException e)
                {
                    PrintError($"{subpath}: Failure due to the --fix-fill-type option. {e.InnerException.Message}");
                }
                catch (Exception e)
                {
                    PrintError($"{subpath}: {e.Message}");
                }

                File.Delete(tempFile);
            }
        }
 public void Run()
 {
     try
     {
         var options = new Options();
         if (CommandLine.Parser.Default.ParseArguments(_args, options))
         {
             Convert(options);
         }
     }
     catch (Exception e)
     {
         PrintError(e.ToString());
     }
 }
 public async Task RunAsync()
 {
     try
     {
         var options = new Options();
         if (CommandLine.Parser.Default.ParseArguments(_args, options))
         {
             Convert(options);
             if (!options.NoUpdateCheck)
             {
                 using (var updateChecker = new UpdateChecker())
                 {
                     await updateChecker.CheckForUpdateAsync();
                 }
             }
         }
     }
     catch (Exception e)
     {
         PrintError(e.ToString());
     }
 }