mirror of
https://github.com/modernw/App-Installer-For-Windows-8.x-Reset.git
synced 2026-06-14 03:16:38 +10:00
Pkgcli: add the confirm before install.
This commit is contained in:
+17
-1
@@ -328,7 +328,8 @@ Commands:
|
|||||||
new CmdParamName ("set"),
|
new CmdParamName ("set"),
|
||||||
new CmdParamName ("refresh"),
|
new CmdParamName ("refresh"),
|
||||||
new CmdParamName ("show"),
|
new CmdParamName ("show"),
|
||||||
new CmdParamName ("encoding", new string [] { "en", "charset", "encode" })
|
new CmdParamName ("encoding", new string [] { "en", "charset", "encode" }),
|
||||||
|
new CmdParamName ("yes", new string [] {"y", "agree"})
|
||||||
});
|
});
|
||||||
RefreshConfig ();
|
RefreshConfig ();
|
||||||
var cmds = parser.Parse (args);
|
var cmds = parser.Parse (args);
|
||||||
@@ -523,6 +524,21 @@ Examples:
|
|||||||
if (!string.IsNullOrWhiteSpace (c.Value)) list.Add (c.Value);
|
if (!string.IsNullOrWhiteSpace (c.Value)) list.Add (c.Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var agreecmd = cmds.GetFromId ("yes");
|
||||||
|
bool? agree = null;
|
||||||
|
if (agreecmd != null) agree = true;
|
||||||
|
if (agree == null)
|
||||||
|
{
|
||||||
|
if (list.Count <= 0) agree = true;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.Write ($"We will uninstall {list.Count} app(-s). Do you want to continue?(Y/N) ");
|
||||||
|
var userinput = Console.ReadLine ();
|
||||||
|
if (userinput.NEquals ("y") || userinput.NEquals ("yes")) agree = true;
|
||||||
|
else agree = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (agree == false) throw new OperationCanceledException ("User canceled.");
|
||||||
for (int i = 0; i < list.Count; i++)
|
for (int i = 0; i < list.Count; i++)
|
||||||
{
|
{
|
||||||
Console.WriteLine ();
|
Console.WriteLine ();
|
||||||
|
|||||||
Reference in New Issue
Block a user