YesAll
This commit is contained in:
parent
16d37990c0
commit
810a4fa8fc
@ -57,11 +57,24 @@ static class Merge
|
||||
}
|
||||
|
||||
public static void ConsoleAskYN(string question, Action? yes, Action? no)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
Log("y", question + " [y/n]");
|
||||
string answ = ColoredConsole.Read("w").ToLower();
|
||||
if (answ == "y") yes?.Invoke();
|
||||
else no?.Invoke();
|
||||
string answ = Program.YesAll ? "y" : ColoredConsole.Read("w").ToLower();
|
||||
if (answ == "y")
|
||||
{
|
||||
Log("c",$"answer: {answ}");
|
||||
yes?.Invoke();
|
||||
break;
|
||||
}
|
||||
if (answ == "n") {
|
||||
Log("c",$"answer: {answ}");
|
||||
no?.Invoke();
|
||||
break;
|
||||
}
|
||||
Log("r", $"incorrect answer: {answ}");
|
||||
}
|
||||
}
|
||||
|
||||
static void HandleConflicts(IOPath[] moddirs)
|
||||
|
||||
@ -17,6 +17,8 @@ public static class Program
|
||||
static ConsoleLogger logger = new($"logs", "main");
|
||||
static void Log(params string[] msg) => logger.Log(msg);
|
||||
|
||||
public static bool YesAll = false;
|
||||
|
||||
static int Main(string[] args)
|
||||
{
|
||||
try
|
||||
@ -28,10 +30,14 @@ public static class Program
|
||||
|
||||
new LaunchArgumentParser(
|
||||
new LaunchArgument(new []{"o", "out"},
|
||||
"sets output path",
|
||||
"Sets output path",
|
||||
p => outPath=p,
|
||||
"out_path",
|
||||
0),
|
||||
new LaunchArgument(new []{"y", "yes-all"},
|
||||
"Automatically answers [Y] to all questions",
|
||||
()=> YesAll=true,
|
||||
0),
|
||||
new LaunchArgument(new []{"clear"},
|
||||
"Clear mod files and put them into separate dirs in output dir. Requires -o",
|
||||
wdir=>Workshop.ClearWorkshop(wdir, outPath),
|
||||
|
||||
@ -6,20 +6,21 @@
|
||||
<RootNamespace>ParadoxModMerger</RootNamespace>
|
||||
<AssemblyName>paradox-mod-merger</AssemblyName>
|
||||
<LangVersion>10</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Include="7z\**" CopyToOutputDirectory="PreserveNewest" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DTLib.Ben.Demystifier" Version="1.0.4" />
|
||||
<PackageReference Include="DTLib.Dtsod" Version="1.2.0" />
|
||||
<PackageReference Include="DTLib.Dtsod" Version="1.2.1" />
|
||||
<PackageReference Include="Fizzler.Systems.HtmlAgilityPack" Version="1.2.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<ProjectReference Include="..\..\DTLib\DTLib\DTLib.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(Configuration)' != 'Debug' ">
|
||||
<PackageReference Include="DTLib" Version="1.2.0" />
|
||||
<PackageReference Include="DTLib" Version="1.2.3" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\diff-text\diff-text.csproj" />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user