From ecbe75a3e362e0771e6eafa5e2d0a6300d5d4549 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sun, 13 Apr 2025 11:55:06 +0200 Subject: [PATCH] Add CheckRidsCommand to check available RIDs for the current OS --- app/Build/Commands/CheckRidsCommand.cs | 21 +++++++++++++++++++++ app/Build/Program.cs | 5 ++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 app/Build/Commands/CheckRidsCommand.cs diff --git a/app/Build/Commands/CheckRidsCommand.cs b/app/Build/Commands/CheckRidsCommand.cs new file mode 100644 index 00000000..62bf3662 --- /dev/null +++ b/app/Build/Commands/CheckRidsCommand.cs @@ -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}"); + } + } +} \ No newline at end of file diff --git a/app/Build/Program.cs b/app/Build/Program.cs index 476ea820..6fe9b058 100644 --- a/app/Build/Program.cs +++ b/app/Build/Program.cs @@ -1,3 +1,6 @@ -var builder = CoconaApp.CreateBuilder(); +using Build.Commands; + +var builder = CoconaApp.CreateBuilder(); var app = builder.Build(); +app.AddCommands(); app.Run(); \ No newline at end of file