diff --git a/AssetStudioCLI/Options/CLIOptions.cs b/AssetStudioCLI/Options/CLIOptions.cs index a7790f7..4e9828f 100644 --- a/AssetStudioCLI/Options/CLIOptions.cs +++ b/AssetStudioCLI/Options/CLIOptions.cs @@ -73,7 +73,7 @@ namespace AssetStudioCLI.Options public static bool isParsed; public static bool showHelp; public static string[] cliArgs; - public static string inputPath; + public static List inputPathList; public static FilterBy filterBy; private static Dictionary optionsDict; private static Dictionary flagsDict; @@ -159,7 +159,7 @@ namespace AssetStudioCLI.Options isParsed = false; showHelp = false; cliArgs = null; - inputPath = ""; + inputPathList = new List(); filterBy = FilterBy.None; optionsDict = new Dictionary(); flagsDict = new Dictionary(); @@ -543,12 +543,16 @@ namespace AssetStudioCLI.Options if (!args[0].StartsWith("-")) { - inputPath = Path.GetFullPath(args[0]).Replace("\"", ""); - if (!Directory.Exists(inputPath) && !File.Exists(inputPath)) + foreach (var path in ValueSplitter(args[0])) { - Console.WriteLine($"{"Error:".Color(brightRed)} Invalid input path \"{args[0].Color(brightRed)}\".\n" + - $"Specified file or folder was not found. The input path must be specified as the first argument."); - return; + var fullPath = Path.GetFullPath(path).Replace("\"", ""); + if (!Directory.Exists(fullPath) && !File.Exists(fullPath)) + { + Console.WriteLine($"{"Error:".Color(brightRed)} Invalid input path \"{fullPath.Color(brightRed)}\".\n" + + $"Specified file or folder was not found. The input path must be specified as the first argument."); + return; + } + inputPathList.Add(fullPath); } } else @@ -1304,7 +1308,7 @@ namespace AssetStudioCLI.Options { sb.AppendLine($"# Parse Assets Using TypeTree: {!f_avoidLoadingViaTypetree.Value}"); } - sb.AppendLine($"# Input Path: \"{inputPath}\""); + sb.AppendLine($"# Input Path: \"{string.Join("\"\n- \"", inputPathList)}\""); if (o_workMode.Value != WorkMode.Info) { sb.AppendLine($"# Output Path: \"{o_outputFolder}\""); diff --git a/AssetStudioCLI/Studio.cs b/AssetStudioCLI/Studio.cs index 30a6ad6..1962706 100644 --- a/AssetStudioCLI/Studio.cs +++ b/AssetStudioCLI/Studio.cs @@ -39,7 +39,7 @@ namespace AssetStudioCLI public static void ExtractBundles() { var extractedCount = 0; - var path = CLIOptions.inputPath; + var path = CLIOptions.inputPathList[0]; var savePath = CLIOptions.o_outputFolder.Value; Progress.Reset(); if (Directory.Exists(path)) @@ -170,7 +170,7 @@ namespace AssetStudioCLI { assetsManager.SetAssetFilter(CLIOptions.o_exportAssetTypes.Value); } - assetsManager.LoadFilesAndFolders(CLIOptions.inputPath); + assetsManager.LoadFilesAndFolders(out _, CLIOptions.inputPathList); if (assetsManager.assetsFileList.Count == 0) { Logger.Warning("No Unity file can be loaded.");