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:
jim
2026-05-28 16:11:35 -05:00
co-authored by Claude Opus 4.8
parent 494d6aa2d4
commit 5973920894
2 changed files with 120 additions and 0 deletions
+6
View File
@@ -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));