#354, add command option -restore_snapshot "[0-9a-z]"

This commit is contained in:
Kang Yu 2025-02-02 11:58:06 -08:00
parent 5a794baf8b
commit 0e622b8021
2 changed files with 39 additions and 1 deletions

View file

@ -82,6 +82,7 @@ if not errorlevel 1 goto wait_to_finish";
bool auto_upgrade = false;
bool legacy_icon = false;
bool waiting_taskbar = false;
int restore_snapshot = -1;
foreach (var arg in args)
{
@ -137,6 +138,11 @@ if not errorlevel 1 goto wait_to_finish";
hotkey = arg[0];
continue;
}
else if (restore_snapshot != -1)
{
restore_snapshot = SnapshotCharToId(arg[0]);
continue;
}
switch(arg)
{
@ -287,9 +293,18 @@ if not errorlevel 1 goto wait_to_finish";
case "-dump_window_pos_at_exit=0":
pwp.dumpDataWhenExit = false;
break;
case "-restore_snapshot":
restore_snapshot = 0;
break;
}
}
if (restore_snapshot >= 0)
{
pwp.RestoreSnapshotCmd(restore_snapshot);
return;
}
string productName = System.Windows.Forms.Application.ProductName;
string appDataFolder = redirect_appdata ? "." :
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),