Esempio n. 1
0
        static void Main(string[] args)
        {
            // parse command line arguments
            var options = new CmdOptions();

            if (CommandLine.Parser.Default.ParseArguments(args, options))
            {
                if (options.InputFiles == null || options.InputFiles.Count == 0)
                {
                    Console.Write(options.GetUsage());
                    return;
                }

                // collect a full file list from the inputs by doing a simple glob style
                // file search.
                List <string> inputFiles = new List <string>();
                foreach (var input in options.InputFiles)
                {
                    inputFiles.AddRange(SimpleGlob(input));
                }

                // create output dir, if necessary
                Directory.CreateDirectory(options.OutputDirectory);

                if (!options.XmlMode)
                {
                    for (int i = 0; i < inputFiles.Count; ++i)
                    {
                        Console.WriteLine("[{1}/{2}] Opening archive {0} ...", Path.GetFileName(inputFiles[i]), i + 1, inputFiles.Count);
                        ExportPsarc(inputFiles[i], options);
                    }
                }
                else
                {
                    ExportXml(inputFiles, options);
                }
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            // parse command line arguments
            var options = new CmdOptions();

            if (CommandLine.Parser.Default.ParseArguments(args, options))
            {
                if (options.InputFiles == null || options.InputFiles.Count == 0)
                {
                    Console.Write(options.GetUsage());
                    return;
                }

                // collect a full file list from the inputs by doing a simple glob style
                // file matching or by scanning a given directory for eligible files
                List <string> inputFiles = new List <string>();
                foreach (var input in options.InputFiles)
                {
                    if (Directory.Exists(input))
                    {
                        inputFiles.AddRange(ScanDirectory(input, options.Recursive));
                    }
                    else
                    {
                        inputFiles.AddRange(SimpleGlob(input));
                    }
                }

                // create output dir, if necessary
                Directory.CreateDirectory(options.OutputDirectory);

                if (!options.XmlMode)
                {
                    if (options.Incremental)
                    {
                        // only process files which were modified since the last run, we do this
                        // by comparing their last modified date against a timestamp file we store
                        // in the output directory
                        inputFiles = FilterOldFiles(inputFiles, options.OutputDirectory);
                    }

                    for (int i = 0; i < inputFiles.Count; ++i)
                    {
                        Console.WriteLine("[{1}/{2}] Opening archive {0} ...", Path.GetFileName(inputFiles[i]), i + 1, inputFiles.Count);
                        ExportPsarc(inputFiles[i], options);
                    }

                    if (inputFiles.Count == 0)
                    {
                        Console.WriteLine("All files up to date. Nothing to do :)");
                    }
                    else
                    {
                        // finally, create a timestamp file in the output directory for future reference
                        var stream = File.CreateText(Path.Combine(options.OutputDirectory, ".rs2tab.timestamp"));
                        stream.Write(System.DateTime.UtcNow);
                        stream.Close();
                    }
                }
                else
                {
                    ExportXml(inputFiles, options);
                }
            }
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            // parse command line arguments
            var options = new CmdOptions();
            if (CommandLine.Parser.Default.ParseArguments(args, options))
            {
                if (options.InputFiles == null || options.InputFiles.Count == 0)
                {
                    Console.Write(options.GetUsage());
                    return;
                }

                // collect a full file list from the inputs by doing a simple glob style
                // file matching or by scanning a given directory for eligible files
                List<string> inputFiles = new List<string>();
                foreach (var input in options.InputFiles)
                {
                    if (Directory.Exists(input))
                        inputFiles.AddRange(ScanDirectory(input, options.Recursive));
                    else
                        inputFiles.AddRange(SimpleGlob(input));
                }

                // create output dir, if necessary
                Directory.CreateDirectory(options.OutputDirectory);

                if (!options.XmlMode)
                {
                    if (options.Incremental)
                    {
                        // only process files which were modified since the last run, we do this
                        // by comparing their last modified date against a timestamp file we store
                        // in the output directory
                        inputFiles = FilterOldFiles(inputFiles, options.OutputDirectory);
                    }

                    for (int i = 0; i < inputFiles.Count; ++i)
                    {
                        Console.WriteLine("[{1}/{2}] Opening archive {0} ...", Path.GetFileName(inputFiles[i]), i+1, inputFiles.Count);
                        ExportPsarc(inputFiles[i], options);
                    }

                    if (inputFiles.Count == 0)
                    {
                        Console.WriteLine("All files up to date. Nothing to do :)");
                    }
                    else
                    {
                        // finally, create a timestamp file in the output directory for future reference
                        var stream = File.CreateText(Path.Combine(options.OutputDirectory, ".rs2tab.timestamp"));
                        stream.Write(System.DateTime.UtcNow);
                        stream.Close();
                    }
                }
                else
                {
                    ExportXml(inputFiles, options);
                }

            }
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            // parse command line arguments
            var options = new CmdOptions();
            if (CommandLine.Parser.Default.ParseArguments(args, options))
            {
                if (options.InputFiles == null || options.InputFiles.Count == 0)
                {
                    Console.Write(options.GetUsage());
                    return;
                }

                // collect a full file list from the inputs by doing a simple glob style
                // file search.
                List<string> inputFiles = new List<string>();
                foreach (var input in options.InputFiles)
                {
                    inputFiles.AddRange(SimpleGlob(input));
                }

                // create output dir, if necessary
                Directory.CreateDirectory(options.OutputDirectory);

                if (!options.XmlMode)
                {
                    for (int i = 0; i < inputFiles.Count; ++i)
                    {
                        Console.WriteLine("[{1}/{2}] Opening archive {0} ...", Path.GetFileName(inputFiles[i]), i+1, inputFiles.Count);
                        ExportPsarc(inputFiles[i], options);
                    }
                }
                else
                {
                    ExportXml(inputFiles, options);
                }
            }
        }