feat: add -revert mode to restore *.bak back to *.txt
Inverse of -output. For each blog with a TTFolderPath, restores every *.bak over its *.txt, first preserving the current *.txt as the next-free *.bkN, then consuming the *.bak. Confirms before running and supports an optional single-blog filter. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
@@ -185,6 +185,8 @@ namespace URLNotesGrabberCORE
|
||||
|
||||
Console.WriteLine("-output\t Export posts from TL.db back to .txt files in each blog's TTFolderPath");
|
||||
|
||||
Console.WriteLine("-revert [blogname]\t Inverse of -output: restore *.bak back to *.txt (current .txt saved as next-free .bkN)");
|
||||
|
||||
Console.WriteLine("-correct [bakPath]\t Dry-run: report multi-line field updates available from a BAK directory");
|
||||
|
||||
Console.WriteLine("-correct -apply [bakPath]\t Apply BAK-file corrections to matching posts (prompts yes/no)");
|
||||
@@ -329,6 +331,10 @@ namespace URLNotesGrabberCORE
|
||||
OutputMode.Run(config);
|
||||
break;
|
||||
|
||||
case "-revert":
|
||||
RevertMode.Run(config, args.Length > 1 ? args[1] : null);
|
||||
break;
|
||||
|
||||
case "-correct":
|
||||
{
|
||||
bool applyChanges = args.Skip(1).Any(a => string.Equals(a, "-apply", StringComparison.OrdinalIgnoreCase) || string.Equals(a, "--apply", StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
Reference in New Issue
Block a user