LANCommander/LANCommander.Launcher/Startup/CommandLine.cs
2025-08-24 20:29:31 -05:00

25 lines
No EOL
704 B
C#

using LANCommander.Launcher.Services;
using Microsoft.Extensions.DependencyInjection;
using Photino.Blazor;
namespace LANCommander.Launcher.Startup;
public static class CommandLine
{
public static bool ParseCommandLine(this PhotinoBlazorApp app, string[] args)
{
if (args.Length > 0)
{
using (var scope = app.Services.CreateScope())
{
var commandLineService = scope.ServiceProvider.GetRequiredService<CommandLineService>();
Task.Run(async () => await commandLineService.ParseCommandLineAsync(args)).GetAwaiter().GetResult();
}
return true;
}
return false;
}
}