private static void Process(CommandLineArguments args)
        {
            switch (args.Action)
            {
            case "create-package":
            {
                CommandLinePackageProcessor.Create();
                break;
            }

            case "extract-package":
            {
                CommandLinePackageProcessor.Extract();
                break;
            }

            case "convert-model":
            {
                CommandLineGR2Processor.UpdateExporterSettings();
                CommandLineGR2Processor.Convert();
                break;
            }

            case "convert-resource":
            {
                CommandLineDataProcessor.Convert();
                break;
            }

            case "extract-packages":
            {
                CommandLinePackageProcessor.BatchExtract();
                break;
            }

            case "convert-models":
            {
                CommandLineGR2Processor.BatchConvert();
                break;
            }

            case "convert-resources":
            {
                CommandLineDataProcessor.BatchConvert();
                break;
            }
            }
        }
Beispiel #2
0
        private static void Process(CommandLineArguments args)
        {
            var expression = new Regex("^" + Regex.Escape(args.Expression).Replace(@"\*", ".*").Replace(@"\?", ".") + "$", RegexOptions.Singleline | RegexOptions.Compiled);

            if (args.UseRegex)
            {
                try
                {
                    expression = new Regex(args.Expression, RegexOptions.Singleline | RegexOptions.Compiled);
                }
                catch (ArgumentException)
                {
                    CommandLineLogger.LogFatal($"Cannot parse RegEx expression: {args.Expression}", -1);
                }
            }

            Func <AbstractFileInfo, bool> filter = obj => obj.Name.Like(expression);

            switch (args.Action)
            {
            case "create-package":
            {
                CommandLinePackageProcessor.Create();
                break;
            }

            case "extract-package":
            {
                CommandLinePackageProcessor.Extract(filter);
                break;
            }

            case "extract-single-file":
            {
                CommandLinePackageProcessor.ExtractSingleFile();
                break;
            }

            case "list-package":
            {
                CommandLinePackageProcessor.ListFiles(filter);
                break;
            }

            case "convert-model":
            {
                CommandLineGR2Processor.UpdateExporterSettings();
                CommandLineGR2Processor.Convert();
                break;
            }

            case "convert-resource":
            {
                CommandLineDataProcessor.Convert();
                break;
            }

            case "extract-packages":
            {
                CommandLinePackageProcessor.BatchExtract(filter);
                break;
            }

            case "convert-models":
            {
                CommandLineGR2Processor.BatchConvert();
                break;
            }

            case "convert-resources":
            {
                CommandLineDataProcessor.BatchConvert();
                break;
            }

            default:
            {
                throw new ArgumentException($"Unhandled action: {args.Action}");
            }
            }
        }