diff --git a/SabreTools.Helper/Dats/Partials/DatFile.ConvertUpdate.cs b/SabreTools.Helper/Dats/Partials/DatFile.ConvertUpdate.cs index 5d37b860..9d10480a 100644 --- a/SabreTools.Helper/Dats/Partials/DatFile.ConvertUpdate.cs +++ b/SabreTools.Helper/Dats/Partials/DatFile.ConvertUpdate.cs @@ -28,7 +28,7 @@ namespace SabreTools.Helper.Dats /// Optional param for output directory /// True if input files should be merged into a single file, false otherwise /// Non-zero flag for diffing mode, zero otherwise - /// True if the cascade-diffed files should overwrite their inputs, false otherwise + /// True if the output files should overwrite their inputs, false otherwise /// True if the first cascaded diff file should be skipped on output, false otherwise /// True if the date should not be appended to the default name, false otherwise [OBSOLETE] /// True to clean the game names to WoD standard, false otherwise (default) @@ -77,7 +77,7 @@ namespace SabreTools.Helper.Dats // Otherwise, loop through all of the inputs individually else { - Update(inputPaths, outDir, clean, remUnicode, descAsName, filter, splitType, trim, single, root); + Update(inputPaths, outDir, inplace, clean, remUnicode, descAsName, filter, splitType, trim, single, root); } return; } @@ -461,7 +461,7 @@ namespace SabreTools.Helper.Dats /// Optional param for output directory /// True if input files should be merged into a single file, false otherwise /// Non-zero flag for diffing mode, zero otherwise - /// True if the cascade-diffed files should overwrite their inputs, false otherwise + /// True if the output files should overwrite their inputs, false otherwise /// True if the first cascaded diff file should be skipped on output, false otherwise /// True if the date should not be appended to the default name, false otherwise [OBSOLETE] /// True to clean the game names to WoD standard, false otherwise (default) @@ -472,7 +472,7 @@ namespace SabreTools.Helper.Dats /// True if we are supposed to trim names to NTFS length, false otherwise /// True if all games should be replaced by '!', false otherwise /// String representing root directory to compare against for length calculation - public void Update(List inputFileNames, string outDir, bool clean, bool remUnicode, bool descAsName, + public void Update(List inputFileNames, string outDir, bool inplace, bool clean, bool remUnicode, bool descAsName, Filter filter, SplitType splitType, bool trim, bool single, string root) { Parallel.ForEach(inputFileNames, Globals.ParallelOptions, inputFileName => @@ -483,6 +483,12 @@ namespace SabreTools.Helper.Dats inputFileName = Path.GetFullPath(inputFileName); } + // If inplace is set, override the output dir + if (inplace) + { + outDir = Path.GetDirectoryName(inputFileName); + } + if (File.Exists(inputFileName)) { DatFile innerDatdata = new DatFile(this); diff --git a/SabreTools.Helper/README.1ST b/SabreTools.Helper/README.1ST index e7305772..a919eff3 100644 --- a/SabreTools.Helper/README.1ST +++ b/SabreTools.Helper/README.1ST @@ -1023,10 +1023,6 @@ Options: leaves the files that are not in one of the previous DATs. This can allow for the creation of rollback sets or even just reduce the amount of duplicates across multiple sets - - -ip, --inplace Enable inplace, cascaded diff - This will overwrite the source files instead of writing them out to the - program folder by default (or the output folder if overridden) -sf, --skip Skip output of first DAT In times where the first DAT does not need to be written out a second time, @@ -1102,6 +1098,11 @@ Options: This sets an output folder to be used when the files are created. If a path is not defined, the application directory is used instead. + -ip, --inplace Enable overwriting in the source file + This will overwrite the source files instead of writing them out to the runtime folder + by default (or the output folder if overridden). Note that this only works for + regular updates and cascaded diffs due to how file are expected to be written. + -mt={4} Amount of threads to use Optionally, set the number of threads to use for the multithreaded operations. The default is 4 threads; -1 means unlimited threads created. If the user specifies