Skip to content

Commit 2a035ff

Browse files
committed
do not close automatically in interactive mode
1 parent 5408ba9 commit 2a035ff

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/ModVerify.CliApp/Options/ModVerifyAppSettings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ namespace AET.ModVerifyTool.Options;
77

88
internal sealed class ModVerifyAppSettings
99
{
10+
public bool Interactive => GameInstallationsSettings.Interactive;
11+
1012
public required VerifyPipelineSettings VerifyPipelineSettings { get; init; }
1113

1214
public required GlobalVerifyReportSettings GlobalReportSettings { get; init; }

src/ModVerify.CliApp/Program.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,16 @@ private static async Task<int> Run(BaseModVerifyOptions options)
8080

8181
logger?.LogDebug($"Raw command line: {Environment.CommandLine}");
8282

83+
var interactive = false;
8384
try
8485
{
8586
var settings = new SettingsBuilder(coreServices).BuildSettings(options);
87+
interactive = settings.Interactive;
8688
var services = CreateAppServices(coreServiceCollection, settings);
8789

8890
if (!settings.Offline)
8991
await CheckForUpdate(services, logger);
90-
91-
92+
9293
var verifier = new ModVerifyApp(settings, services);
9394
return await verifier.RunApplication().ConfigureAwait(false);
9495
}
@@ -105,6 +106,13 @@ private static async Task<int> Run(BaseModVerifyOptions options)
105106
#else
106107
Log.CloseAndFlush();
107108
#endif
109+
if (interactive)
110+
{
111+
Console.WriteLine();
112+
ConsoleUtilities.WriteHorizontalLine('-');
113+
Console.WriteLine("Press any key to exit");
114+
Console.ReadLine();
115+
}
108116
}
109117
}
110118

src/ModVerify.CliApp/SettingsBuilder.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public ModVerifyAppSettings BuildSettings(BaseModVerifyOptions options)
3131
throw new NotSupportedException($"The option '{options.GetType().Name}' is not supported!");
3232
}
3333

34-
3534
private ModVerifyAppSettings BuildFromVerifyVerb(VerifyVerbOption verifyOptions)
3635
{
3736
var output = Environment.CurrentDirectory;

0 commit comments

Comments
 (0)