Add CheckRidsCommand to check available RIDs for the current OS

This commit is contained in:
Thorsten Sommer 2025-04-13 11:55:06 +02:00
parent 7aa1d73b8c
commit ecbe75a3e3
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 25 additions and 1 deletions

View File

@ -0,0 +1,21 @@
// ReSharper disable ClassNeverInstantiated.Global
// ReSharper disable UnusedType.Global
// ReSharper disable UnusedMember.Global
namespace Build.Commands;
public sealed class CheckRidsCommand
{
[Command("check-rids", Description = "Check the RIDs for the current OS")]
public void GetRids()
{
if(!Environment.IsWorkingDirectoryValid())
return;
var rids = Environment.GetRidsForCurrentOS();
Console.WriteLine("The following RIDs are available for the current OS:");
foreach (var rid in rids)
{
Console.WriteLine($"- {rid}");
}
}
}

View File

@ -1,3 +1,6 @@
var builder = CoconaApp.CreateBuilder(); using Build.Commands;
var builder = CoconaApp.CreateBuilder();
var app = builder.Build(); var app = builder.Build();
app.AddCommands<CheckRidsCommand>();
app.Run(); app.Run();