Exemple #1
0
        private static void Main(string[] args)
        {
            Parser.Default.ParseArguments <Options>(args)
            .WithParsed(options =>
            {
                if (!Directory.Exists(options.InputDirectoryPath))
                {
                    throw new DirectoryNotFoundException($"Cannot find directory : {options.InputDirectoryPath}");
                }

                if (options.Size <= 0)
                {
                    throw new Exception("Size must be superior to 0");
                }

                using (new MagickTmpDir())
                {
                    var inputDir = new DirectoryInfo(options.InputDirectoryPath);

                    PrepareInput.CreateInputArchive(inputDir, options.OutputPath, options.Size, options.Limit,
                                                    options.RecursiveSearch);

                    Console.WriteLine($"Done output file : {options.OutputPath}");
                }
            });
        }
Exemple #2
0
        public static void CreateInputArchive(DirectoryInfo dir, string archiveName, int size = 20, int limit = 5000,
                                              bool recursiveSearch = true)
        {
            var prepareInput = new PrepareInput(dir, size, limit, recursiveSearch);

            prepareInput.CreateInputArchive(archiveName);
        }