Преглед изворни кода

Merge pull request #192 from Timmoth/Command-Refactor-and-reformatting

Command refactor and reformatting
Tim Jones пре 1 месец
родитељ
комит
cd424cbfad
62 измењених фајлова са 355 додато и 404 уклоњено
  1. 3 2
      Shared.Rcl/Commands/AccessPoints/Labels/AccessPointLabelAddCommand.cs
  2. 5 3
      Shared.Rcl/Commands/AccessPoints/Labels/AccessPointLabelRemoveCommand.cs
  3. 6 8
      Shared.Rcl/Commands/Ansible/GenerateAnsibleInventoryCommand.cs
  4. 20 0
      Shared.Rcl/Commands/Desktops/Cpus/DesktopCpuAddCommand.cs
  5. 0 23
      Shared.Rcl/Commands/Desktops/Cpus/DesktopCpuAddSettings.cs
  6. 12 0
      Shared.Rcl/Commands/Desktops/Cpus/DesktopCpuRemoveCommand.cs
  7. 0 15
      Shared.Rcl/Commands/Desktops/Cpus/DesktopCpuRemoveSettings.cs
  8. 26 5
      Shared.Rcl/Commands/Desktops/Cpus/DesktopCpuSetCommand.cs
  9. 0 27
      Shared.Rcl/Commands/Desktops/Cpus/DesktopCpuSetSettings.cs
  10. 16 0
      Shared.Rcl/Commands/Desktops/Drive/DesktopDriveAddCommand.cs
  11. 0 19
      Shared.Rcl/Commands/Desktops/Drive/DesktopDriveAddSettings.cs
  12. 12 0
      Shared.Rcl/Commands/Desktops/Drive/DesktopDriveRemoveCommand.cs
  13. 0 15
      Shared.Rcl/Commands/Desktops/Drive/DesktopDriveRemoveSettings.cs
  14. 20 0
      Shared.Rcl/Commands/Desktops/Drive/DesktopDriveSetCommand.cs
  15. 0 23
      Shared.Rcl/Commands/Desktops/Drive/DesktopDriveSetSettings.cs
  16. 16 0
      Shared.Rcl/Commands/Desktops/Gpus/DesktopGpuAddCommand.cs
  17. 0 19
      Shared.Rcl/Commands/Desktops/Gpus/DesktopGpuAddSettings.cs
  18. 12 0
      Shared.Rcl/Commands/Desktops/Gpus/DesktopGpuRemoveCommand.cs
  19. 0 15
      Shared.Rcl/Commands/Desktops/Gpus/DesktopGpuRemoveSettings.cs
  20. 20 0
      Shared.Rcl/Commands/Desktops/Gpus/DesktopGpuSetCommand.cs
  21. 0 23
      Shared.Rcl/Commands/Desktops/Gpus/DesktopGpuSetSettings.cs
  22. 3 2
      Shared.Rcl/Commands/Desktops/Labels/DesktopLabelAddCommand.cs
  23. 3 2
      Shared.Rcl/Commands/Desktops/Labels/DesktopLabelRemoveCommand.cs
  24. 20 0
      Shared.Rcl/Commands/Desktops/Nics/DesktopNicAddCommand.cs
  25. 0 23
      Shared.Rcl/Commands/Desktops/Nics/DesktopNicAddSettings.cs
  26. 12 0
      Shared.Rcl/Commands/Desktops/Nics/DesktopNicRemoveCommand.cs
  27. 0 15
      Shared.Rcl/Commands/Desktops/Nics/DesktopNicRemoveSettings.cs
  28. 24 0
      Shared.Rcl/Commands/Desktops/Nics/DesktopNicSetCommand.cs
  29. 0 27
      Shared.Rcl/Commands/Desktops/Nics/DesktopNicSetSettings.cs
  30. 3 2
      Shared.Rcl/Commands/Firewalls/Labels/FirewallLabelAddCommand.cs
  31. 3 2
      Shared.Rcl/Commands/Firewalls/Labels/FirewallLabelRemoveCommand.cs
  32. 20 0
      Shared.Rcl/Commands/Laptops/Cpus/LaptopCpuAddCommand.cs
  33. 0 23
      Shared.Rcl/Commands/Laptops/Cpus/LaptopCpuAddSettings.cs
  34. 12 0
      Shared.Rcl/Commands/Laptops/Cpus/LaptopCpuRemoveCommand.cs
  35. 0 15
      Shared.Rcl/Commands/Laptops/Cpus/LaptopCpuRemoveSettings.cs
  36. 24 0
      Shared.Rcl/Commands/Laptops/Cpus/LaptopCpuSetCommand.cs
  37. 0 27
      Shared.Rcl/Commands/Laptops/Cpus/LaptopCpuSetSettings.cs
  38. 3 2
      Shared.Rcl/Commands/Laptops/Labels/LaptopLabelAddCommand.cs
  39. 3 2
      Shared.Rcl/Commands/Laptops/Labels/LaptopLabelRemoveCommand.cs
  40. 3 2
      Shared.Rcl/Commands/Routers/Labels/RouterLabelAddCommand.cs
  41. 3 2
      Shared.Rcl/Commands/Routers/Labels/RouterLabelRemoveCommand.cs
  42. 3 5
      Shared.Rcl/Commands/Servers/Labels/ServerLabelAddCommand.cs
  43. 2 3
      Shared.Rcl/Commands/Servers/Labels/ServerLabelRemoveCommand.cs
  44. 3 2
      Shared.Rcl/Commands/Services/Labels/ServiceLabelAddCommand.cs
  45. 3 2
      Shared.Rcl/Commands/Services/Labels/ServiceLabelRemoveCommand.cs
  46. 3 2
      Shared.Rcl/Commands/Services/ServiceDescribeCommand.cs
  47. 1 1
      Shared.Rcl/Commands/Services/ServiceGetByNameCommand.cs
  48. 4 10
      Shared.Rcl/Commands/Services/ServiceGetCommand.cs
  49. 3 9
      Shared.Rcl/Commands/Services/ServiceReportCommand.cs
  50. 1 1
      Shared.Rcl/Commands/Services/ServiceSetCommand.cs
  51. 2 5
      Shared.Rcl/Commands/Services/ServiceSubnetsCommand.cs
  52. 3 2
      Shared.Rcl/Commands/Switches/Labels/SwitchLabelAddCommand.cs
  53. 3 2
      Shared.Rcl/Commands/Switches/Labels/SwitchLabelRemoveCommand.cs
  54. 3 2
      Shared.Rcl/Commands/Systems/Labels/SystemLabelAddCommand.cs
  55. 3 2
      Shared.Rcl/Commands/Systems/Labels/SystemLabelRemoveCommand.cs
  56. 2 2
      Shared.Rcl/Commands/Systems/SystemDescribeCommand.cs
  57. 1 1
      Shared.Rcl/Commands/Systems/SystemGetByNameCommand.cs
  58. 1 1
      Shared.Rcl/Commands/Systems/SystemGetCommand.cs
  59. 1 1
      Shared.Rcl/Commands/Systems/SystemReportCommand.cs
  60. 1 2
      Shared.Rcl/Commands/Systems/SystemSetCommand.cs
  61. 4 3
      Shared.Rcl/Commands/Ups/Labels/UpsLabelAddCommand.cs
  62. 4 3
      Shared.Rcl/Commands/Ups/Labels/UpsLabelRemoveCommand.cs

+ 3 - 2
Shared.Rcl/Commands/AccessPoints/Labels/AccessPointLabelAddCommand.cs

@@ -14,7 +14,8 @@ public class AccessPointLabelAddSettings : AccessPointNameSettings
 
 public class AccessPointLabelAddCommand(IServiceProvider serviceProvider) : AsyncCommand<AccessPointLabelAddSettings>
 {
-    public override async Task<int> ExecuteAsync(CommandContext context, AccessPointLabelAddSettings settings, CancellationToken cancellationToken)
+    public override async Task<int> ExecuteAsync(CommandContext context, AccessPointLabelAddSettings settings,
+        CancellationToken cancellationToken)
     {
         using var scope = serviceProvider.CreateScope();
         var useCase = scope.ServiceProvider.GetRequiredService<IAddLabelUseCase<AccessPoint>>();
@@ -22,4 +23,4 @@ public class AccessPointLabelAddCommand(IServiceProvider serviceProvider) : Asyn
         AnsiConsole.MarkupLine($"[green]Label '{settings.Key}' added to '{settings.Name}'.[/]");
         return 0;
     }
-}
+}

+ 5 - 3
Shared.Rcl/Commands/AccessPoints/Labels/AccessPointLabelRemoveCommand.cs

@@ -11,9 +11,11 @@ public class AccessPointLabelRemoveSettings : AccessPointNameSettings
     [CommandOption("--key <KEY>")] public string Key { get; set; } = default!;
 }
 
-public class AccessPointLabelRemoveCommand(IServiceProvider serviceProvider) : AsyncCommand<AccessPointLabelRemoveSettings>
+public class AccessPointLabelRemoveCommand(IServiceProvider serviceProvider)
+    : AsyncCommand<AccessPointLabelRemoveSettings>
 {
-    public override async Task<int> ExecuteAsync(CommandContext context, AccessPointLabelRemoveSettings settings, CancellationToken cancellationToken)
+    public override async Task<int> ExecuteAsync(CommandContext context, AccessPointLabelRemoveSettings settings,
+        CancellationToken cancellationToken)
     {
         using var scope = serviceProvider.CreateScope();
         var useCase = scope.ServiceProvider.GetRequiredService<IRemoveLabelUseCase<AccessPoint>>();
@@ -21,4 +23,4 @@ public class AccessPointLabelRemoveCommand(IServiceProvider serviceProvider) : A
         AnsiConsole.MarkupLine($"[green]Label '{settings.Key}' removed from '{settings.Name}'.[/]");
         return 0;
     }
-}
+}

+ 6 - 8
Shared.Rcl/Commands/Ansible/GenerateAnsibleInventoryCommand.cs

@@ -1,9 +1,8 @@
-using RackPeek.Domain.Resources.Desktops;
+using System.ComponentModel;
 using Microsoft.Extensions.DependencyInjection;
+using RackPeek.Domain.UseCases.Ansible;
 using Spectre.Console;
 using Spectre.Console.Cli;
-using System.ComponentModel;
-using RackPeek.Domain.UseCases.Ansible;
 
 namespace Shared.Rcl.Commands.Ansible;
 
@@ -26,7 +25,6 @@ public sealed class GenerateAnsibleInventorySettings : CommandSettings
     public string? OutputPath { get; init; }
 }
 
-
 public sealed class GenerateAnsibleInventoryCommand(IServiceProvider provider)
     : AsyncCommand<GenerateAnsibleInventorySettings>
 {
@@ -44,7 +42,7 @@ public sealed class GenerateAnsibleInventoryCommand(IServiceProvider provider)
         {
             GroupByTags = ParseCsv(settings.GroupTags),
             GroupByLabelKeys = ParseCsv(settings.GroupLabels),
-            GlobalVars = ParseGlobalVars(settings.GlobalVars),
+            GlobalVars = ParseGlobalVars(settings.GlobalVars)
         };
 
         var result = await useCase.ExecuteAsync(options);
@@ -88,9 +86,9 @@ public sealed class GenerateAnsibleInventoryCommand(IServiceProvider provider)
             return [];
 
         return raw.Split(',', StringSplitOptions.RemoveEmptyEntries)
-                  .Select(x => x.Trim())
-                  .Where(x => !string.IsNullOrWhiteSpace(x))
-                  .ToArray();
+            .Select(x => x.Trim())
+            .Where(x => !string.IsNullOrWhiteSpace(x))
+            .ToArray();
     }
 
     private static IDictionary<string, string> ParseGlobalVars(string[] vars)

+ 20 - 0
Shared.Rcl/Commands/Desktops/Cpus/DesktopCpuAddCommand.cs

@@ -1,3 +1,4 @@
+using System.ComponentModel;
 using Microsoft.Extensions.DependencyInjection;
 using RackPeek.Domain.Resources.Desktops;
 using RackPeek.Domain.UseCases.Cpus;
@@ -6,6 +7,25 @@ using Spectre.Console.Cli;
 
 namespace Shared.Rcl.Commands.Desktops.Cpus;
 
+public class DesktopCpuAddSettings : CommandSettings
+{
+    [CommandArgument(0, "<desktop>")]
+    [Description("The desktop name.")]
+    public string DesktopName { get; set; } = default!;
+
+    [CommandOption("--model")]
+    [Description("The model name.")]
+    public string? Model { get; set; }
+
+    [CommandOption("--cores")]
+    [Description("The number of cpu cores.")]
+    public int? Cores { get; set; }
+
+    [CommandOption("--threads")]
+    [Description("The number of cpu threads.")]
+    public int? Threads { get; set; }
+}
+
 public class DesktopCpuAddCommand(IServiceProvider provider)
     : AsyncCommand<DesktopCpuAddSettings>
 {

+ 0 - 23
Shared.Rcl/Commands/Desktops/Cpus/DesktopCpuAddSettings.cs

@@ -1,23 +0,0 @@
-using System.ComponentModel;
-using Spectre.Console.Cli;
-
-namespace Shared.Rcl.Commands.Desktops.Cpus;
-
-public class DesktopCpuAddSettings : CommandSettings
-{
-    [CommandArgument(0, "<desktop>")]
-    [Description("The desktop name.")]
-    public string DesktopName { get; set; } = default!;
-
-    [CommandOption("--model")]
-    [Description("The model name.")]
-    public string? Model { get; set; }
-
-    [CommandOption("--cores")]
-    [Description("The number of cpu cores.")]
-    public int? Cores { get; set; }
-
-    [CommandOption("--threads")]
-    [Description("The number of cpu threads.")]
-    public int? Threads { get; set; }
-}

+ 12 - 0
Shared.Rcl/Commands/Desktops/Cpus/DesktopCpuRemoveCommand.cs

@@ -1,3 +1,4 @@
+using System.ComponentModel;
 using Microsoft.Extensions.DependencyInjection;
 using RackPeek.Domain.Resources.Desktops;
 using RackPeek.Domain.UseCases.Cpus;
@@ -6,6 +7,17 @@ using Spectre.Console.Cli;
 
 namespace Shared.Rcl.Commands.Desktops.Cpus;
 
+public class DesktopCpuRemoveSettings : CommandSettings
+{
+    [CommandArgument(0, "<desktop>")]
+    [Description("The name of the desktop.")]
+    public string DesktopName { get; set; } = default!;
+
+    [CommandArgument(1, "<index>")]
+    [Description("The index of the desktop cpu to remove.")]
+    public int Index { get; set; }
+}
+
 public class DesktopCpuRemoveCommand(IServiceProvider provider)
     : AsyncCommand<DesktopCpuRemoveSettings>
 {

+ 0 - 15
Shared.Rcl/Commands/Desktops/Cpus/DesktopCpuRemoveSettings.cs

@@ -1,15 +0,0 @@
-using System.ComponentModel;
-using Spectre.Console.Cli;
-
-namespace Shared.Rcl.Commands.Desktops.Cpus;
-
-public class DesktopCpuRemoveSettings : CommandSettings
-{
-    [CommandArgument(0, "<desktop>")]
-    [Description("The name of the desktop.")]
-    public string DesktopName { get; set; } = default!;
-
-    [CommandArgument(1, "<index>")]
-    [Description("The index of the desktop cpu to remove.")]
-    public int Index { get; set; }
-}

+ 26 - 5
Shared.Rcl/Commands/Desktops/Cpus/DesktopCpuSetCommand.cs

@@ -1,3 +1,4 @@
+using System.ComponentModel;
 using Microsoft.Extensions.DependencyInjection;
 using RackPeek.Domain.Resources.Desktops;
 using RackPeek.Domain.UseCases.Cpus;
@@ -6,12 +7,32 @@ using Spectre.Console.Cli;
 
 namespace Shared.Rcl.Commands.Desktops.Cpus;
 
-public class DesktopCpuSetCommand(IServiceProvider provider)
-    : AsyncCommand<DesktopCpuSetSettings>
+public class DesktopCpuSetSettings : CommandSettings
 {
-    public override async Task<int> ExecuteAsync(
-        CommandContext context,
-        DesktopCpuSetSettings settings,
+    [CommandArgument(0, "<desktop>")]
+    [Description("The desktop name.")]
+    public string DesktopName { get; set; } = default!;
+
+    [CommandArgument(1, "<index>")]
+    [Description("The index of the desktop cpu.")]
+    public int Index { get; set; }
+
+    [CommandOption("--model")]
+    [Description("The cpu model.")]
+    public string? Model { get; set; }
+
+    [CommandOption("--cores")]
+    [Description("The number of cpu cores.")]
+    public int? Cores { get; set; }
+
+    [CommandOption("--threads")]
+    [Description("The number of cpu threads.")]
+    public int? Threads { get; set; }
+}
+
+public class DesktopCpuSetCommand(IServiceProvider provider) : AsyncCommand<DesktopCpuSetSettings>
+{
+    public override async Task<int> ExecuteAsync(CommandContext context, DesktopCpuSetSettings settings,
         CancellationToken cancellationToken)
     {
         using var scope = provider.CreateScope();

+ 0 - 27
Shared.Rcl/Commands/Desktops/Cpus/DesktopCpuSetSettings.cs

@@ -1,27 +0,0 @@
-using System.ComponentModel;
-using Spectre.Console.Cli;
-
-namespace Shared.Rcl.Commands.Desktops.Cpus;
-
-public class DesktopCpuSetSettings : CommandSettings
-{
-    [CommandArgument(0, "<desktop>")]
-    [Description("The desktop name.")]
-    public string DesktopName { get; set; } = default!;
-
-    [CommandArgument(1, "<index>")]
-    [Description("The index of the desktop cpu.")]
-    public int Index { get; set; }
-
-    [CommandOption("--model")]
-    [Description("The cpu model.")]
-    public string? Model { get; set; }
-
-    [CommandOption("--cores")]
-    [Description("The number of cpu cores.")]
-    public int? Cores { get; set; }
-
-    [CommandOption("--threads")]
-    [Description("The number of cpu threads.")]
-    public int? Threads { get; set; }
-}

+ 16 - 0
Shared.Rcl/Commands/Desktops/Drive/DesktopDriveAddCommand.cs

@@ -1,3 +1,4 @@
+using System.ComponentModel;
 using Microsoft.Extensions.DependencyInjection;
 using RackPeek.Domain.Resources.Desktops;
 using RackPeek.Domain.UseCases.Drives;
@@ -6,6 +7,21 @@ using Spectre.Console.Cli;
 
 namespace Shared.Rcl.Commands.Desktops.Drive;
 
+public class DesktopDriveAddSettings : CommandSettings
+{
+    [CommandArgument(0, "<desktop>")]
+    [Description("The name of the desktop.")]
+    public string DesktopName { get; set; } = default!;
+
+    [CommandOption("--type")]
+    [Description("The drive type e.g hdd / ssd.")]
+    public string? Type { get; set; }
+
+    [CommandOption("--size")]
+    [Description("The drive capacity in GB.")]
+    public int? Size { get; set; }
+}
+
 public class DesktopDriveAddCommand(IServiceProvider provider)
     : AsyncCommand<DesktopDriveAddSettings>
 {

+ 0 - 19
Shared.Rcl/Commands/Desktops/Drive/DesktopDriveAddSettings.cs

@@ -1,19 +0,0 @@
-using System.ComponentModel;
-using Spectre.Console.Cli;
-
-namespace Shared.Rcl.Commands.Desktops.Drive;
-
-public class DesktopDriveAddSettings : CommandSettings
-{
-    [CommandArgument(0, "<desktop>")]
-    [Description("The name of the desktop.")]
-    public string DesktopName { get; set; } = default!;
-
-    [CommandOption("--type")]
-    [Description("The drive type e.g hdd / ssd.")]
-    public string? Type { get; set; }
-
-    [CommandOption("--size")]
-    [Description("The drive capacity in GB.")]
-    public int? Size { get; set; }
-}

+ 12 - 0
Shared.Rcl/Commands/Desktops/Drive/DesktopDriveRemoveCommand.cs

@@ -1,3 +1,4 @@
+using System.ComponentModel;
 using Microsoft.Extensions.DependencyInjection;
 using RackPeek.Domain.Resources.Desktops;
 using RackPeek.Domain.UseCases.Drives;
@@ -6,6 +7,17 @@ using Spectre.Console.Cli;
 
 namespace Shared.Rcl.Commands.Desktops.Drive;
 
+public class DesktopDriveRemoveSettings : CommandSettings
+{
+    [CommandArgument(0, "<desktop>")]
+    [Description("The name of the desktop.")]
+    public string DesktopName { get; set; } = default!;
+
+    [CommandArgument(1, "<index>")]
+    [Description("The index of the drive to remove.")]
+    public int Index { get; set; }
+}
+
 public class DesktopDriveRemoveCommand(IServiceProvider provider)
     : AsyncCommand<DesktopDriveRemoveSettings>
 {

+ 0 - 15
Shared.Rcl/Commands/Desktops/Drive/DesktopDriveRemoveSettings.cs

@@ -1,15 +0,0 @@
-using System.ComponentModel;
-using Spectre.Console.Cli;
-
-namespace Shared.Rcl.Commands.Desktops.Drive;
-
-public class DesktopDriveRemoveSettings : CommandSettings
-{
-    [CommandArgument(0, "<desktop>")]
-    [Description("The name of the desktop.")]
-    public string DesktopName { get; set; } = default!;
-
-    [CommandArgument(1, "<index>")]
-    [Description("The index of the drive to remove.")]
-    public int Index { get; set; }
-}

+ 20 - 0
Shared.Rcl/Commands/Desktops/Drive/DesktopDriveSetCommand.cs

@@ -1,3 +1,4 @@
+using System.ComponentModel;
 using Microsoft.Extensions.DependencyInjection;
 using RackPeek.Domain.Resources.Desktops;
 using RackPeek.Domain.UseCases.Drives;
@@ -6,6 +7,25 @@ using Spectre.Console.Cli;
 
 namespace Shared.Rcl.Commands.Desktops.Drive;
 
+public class DesktopDriveSetSettings : CommandSettings
+{
+    [CommandArgument(0, "<desktop>")]
+    [Description("The desktop name.")]
+    public string DesktopName { get; set; } = default!;
+
+    [CommandArgument(1, "<index>")]
+    [Description("The drive index to update.")]
+    public int Index { get; set; }
+
+    [CommandOption("--type")]
+    [Description("The drive type e.g hdd / ssd.")]
+    public string? Type { get; set; }
+
+    [CommandOption("--size")]
+    [Description("The drive capacity in Gb.")]
+    public int? Size { get; set; }
+}
+
 public class DesktopDriveSetCommand(IServiceProvider provider)
     : AsyncCommand<DesktopDriveSetSettings>
 {

+ 0 - 23
Shared.Rcl/Commands/Desktops/Drive/DesktopDriveSetSettings.cs

@@ -1,23 +0,0 @@
-using System.ComponentModel;
-using Spectre.Console.Cli;
-
-namespace Shared.Rcl.Commands.Desktops.Drive;
-
-public class DesktopDriveSetSettings : CommandSettings
-{
-    [CommandArgument(0, "<desktop>")]
-    [Description("The desktop name.")]
-    public string DesktopName { get; set; } = default!;
-
-    [CommandArgument(1, "<index>")]
-    [Description("The drive index to update.")]
-    public int Index { get; set; }
-
-    [CommandOption("--type")]
-    [Description("The drive type e.g hdd / ssd.")]
-    public string? Type { get; set; }
-
-    [CommandOption("--size")]
-    [Description("The drive capacity in Gb.")]
-    public int? Size { get; set; }
-}

+ 16 - 0
Shared.Rcl/Commands/Desktops/Gpus/DesktopGpuAddCommand.cs

@@ -1,3 +1,4 @@
+using System.ComponentModel;
 using Microsoft.Extensions.DependencyInjection;
 using RackPeek.Domain.Resources.Desktops;
 using RackPeek.Domain.UseCases.Gpus;
@@ -6,6 +7,21 @@ using Spectre.Console.Cli;
 
 namespace Shared.Rcl.Commands.Desktops.Gpus;
 
+public class DesktopGpuAddSettings : CommandSettings
+{
+    [CommandArgument(0, "<desktop>")]
+    [Description("The name of the desktop.")]
+    public string DesktopName { get; set; } = default!;
+
+    [CommandOption("--model")]
+    [Description("The Gpu model.")]
+    public string? Model { get; set; }
+
+    [CommandOption("--vram")]
+    [Description("The amount of gpu vram in Gb.")]
+    public int? Vram { get; set; }
+}
+
 public class DesktopGpuAddCommand(IServiceProvider provider)
     : AsyncCommand<DesktopGpuAddSettings>
 {

+ 0 - 19
Shared.Rcl/Commands/Desktops/Gpus/DesktopGpuAddSettings.cs

@@ -1,19 +0,0 @@
-using System.ComponentModel;
-using Spectre.Console.Cli;
-
-namespace Shared.Rcl.Commands.Desktops.Gpus;
-
-public class DesktopGpuAddSettings : CommandSettings
-{
-    [CommandArgument(0, "<desktop>")]
-    [Description("The name of the desktop.")]
-    public string DesktopName { get; set; } = default!;
-
-    [CommandOption("--model")]
-    [Description("The Gpu model.")]
-    public string? Model { get; set; }
-
-    [CommandOption("--vram")]
-    [Description("The amount of gpu vram in Gb.")]
-    public int? Vram { get; set; }
-}

+ 12 - 0
Shared.Rcl/Commands/Desktops/Gpus/DesktopGpuRemoveCommand.cs

@@ -1,3 +1,4 @@
+using System.ComponentModel;
 using Microsoft.Extensions.DependencyInjection;
 using RackPeek.Domain.Resources.Desktops;
 using RackPeek.Domain.UseCases.Gpus;
@@ -6,6 +7,17 @@ using Spectre.Console.Cli;
 
 namespace Shared.Rcl.Commands.Desktops.Gpus;
 
+public class DesktopGpuRemoveSettings : CommandSettings
+{
+    [CommandArgument(0, "<desktop>")]
+    [Description("The desktop name.")]
+    public string DesktopName { get; set; } = default!;
+
+    [CommandArgument(1, "<index>")]
+    [Description("The index of the Gpu to remove.")]
+    public int Index { get; set; }
+}
+
 public class DesktopGpuRemoveCommand(IServiceProvider provider)
     : AsyncCommand<DesktopGpuRemoveSettings>
 {

+ 0 - 15
Shared.Rcl/Commands/Desktops/Gpus/DesktopGpuRemoveSettings.cs

@@ -1,15 +0,0 @@
-using System.ComponentModel;
-using Spectre.Console.Cli;
-
-namespace Shared.Rcl.Commands.Desktops.Gpus;
-
-public class DesktopGpuRemoveSettings : CommandSettings
-{
-    [CommandArgument(0, "<desktop>")]
-    [Description("The desktop name.")]
-    public string DesktopName { get; set; } = default!;
-
-    [CommandArgument(1, "<index>")]
-    [Description("The index of the Gpu to remove.")]
-    public int Index { get; set; }
-}

+ 20 - 0
Shared.Rcl/Commands/Desktops/Gpus/DesktopGpuSetCommand.cs

@@ -1,3 +1,4 @@
+using System.ComponentModel;
 using Microsoft.Extensions.DependencyInjection;
 using RackPeek.Domain.Resources.Desktops;
 using RackPeek.Domain.UseCases.Gpus;
@@ -6,6 +7,25 @@ using Spectre.Console.Cli;
 
 namespace Shared.Rcl.Commands.Desktops.Gpus;
 
+public class DesktopGpuSetSettings : CommandSettings
+{
+    [CommandArgument(0, "<desktop>")]
+    [Description("The desktop name.")]
+    public string DesktopName { get; set; } = default!;
+
+    [CommandArgument(1, "<index>")]
+    [Description("The index of the gpu to update.")]
+    public int Index { get; set; }
+
+    [CommandOption("--model")]
+    [Description("The gpu model name.")]
+    public string? Model { get; set; }
+
+    [CommandOption("--vram")]
+    [Description("The amount of gpu vram in Gb.")]
+    public int? Vram { get; set; }
+}
+
 public class DesktopGpuSetCommand(IServiceProvider provider)
     : AsyncCommand<DesktopGpuSetSettings>
 {

+ 0 - 23
Shared.Rcl/Commands/Desktops/Gpus/DesktopGpuSetSettings.cs

@@ -1,23 +0,0 @@
-using System.ComponentModel;
-using Spectre.Console.Cli;
-
-namespace Shared.Rcl.Commands.Desktops.Gpus;
-
-public class DesktopGpuSetSettings : CommandSettings
-{
-    [CommandArgument(0, "<desktop>")]
-    [Description("The desktop name.")]
-    public string DesktopName { get; set; } = default!;
-
-    [CommandArgument(1, "<index>")]
-    [Description("The index of the gpu to update.")]
-    public int Index { get; set; }
-
-    [CommandOption("--model")]
-    [Description("The gpu model name.")]
-    public string? Model { get; set; }
-
-    [CommandOption("--vram")]
-    [Description("The amount of gpu vram in Gb.")]
-    public int? Vram { get; set; }
-}

+ 3 - 2
Shared.Rcl/Commands/Desktops/Labels/DesktopLabelAddCommand.cs

@@ -14,7 +14,8 @@ public class DesktopLabelAddSettings : DesktopNameSettings
 
 public class DesktopLabelAddCommand(IServiceProvider serviceProvider) : AsyncCommand<DesktopLabelAddSettings>
 {
-    public override async Task<int> ExecuteAsync(CommandContext context, DesktopLabelAddSettings settings, CancellationToken cancellationToken)
+    public override async Task<int> ExecuteAsync(CommandContext context, DesktopLabelAddSettings settings,
+        CancellationToken cancellationToken)
     {
         using var scope = serviceProvider.CreateScope();
         var useCase = scope.ServiceProvider.GetRequiredService<IAddLabelUseCase<Desktop>>();
@@ -22,4 +23,4 @@ public class DesktopLabelAddCommand(IServiceProvider serviceProvider) : AsyncCom
         AnsiConsole.MarkupLine($"[green]Label '{settings.Key}' added to '{settings.Name}'.[/]");
         return 0;
     }
-}
+}

+ 3 - 2
Shared.Rcl/Commands/Desktops/Labels/DesktopLabelRemoveCommand.cs

@@ -13,7 +13,8 @@ public class DesktopLabelRemoveSettings : DesktopNameSettings
 
 public class DesktopLabelRemoveCommand(IServiceProvider serviceProvider) : AsyncCommand<DesktopLabelRemoveSettings>
 {
-    public override async Task<int> ExecuteAsync(CommandContext context, DesktopLabelRemoveSettings settings, CancellationToken cancellationToken)
+    public override async Task<int> ExecuteAsync(CommandContext context, DesktopLabelRemoveSettings settings,
+        CancellationToken cancellationToken)
     {
         using var scope = serviceProvider.CreateScope();
         var useCase = scope.ServiceProvider.GetRequiredService<IRemoveLabelUseCase<Desktop>>();
@@ -21,4 +22,4 @@ public class DesktopLabelRemoveCommand(IServiceProvider serviceProvider) : Async
         AnsiConsole.MarkupLine($"[green]Label '{settings.Key}' removed from '{settings.Name}'.[/]");
         return 0;
     }
-}
+}

+ 20 - 0
Shared.Rcl/Commands/Desktops/Nics/DesktopNicAddCommand.cs

@@ -1,3 +1,4 @@
+using System.ComponentModel;
 using Microsoft.Extensions.DependencyInjection;
 using RackPeek.Domain.Resources.Desktops;
 using RackPeek.Domain.UseCases.Nics;
@@ -6,6 +7,25 @@ using Spectre.Console.Cli;
 
 namespace Shared.Rcl.Commands.Desktops.Nics;
 
+public class DesktopNicAddSettings : CommandSettings
+{
+    [CommandArgument(0, "<desktop>")]
+    [Description("The desktop name.")]
+    public string DesktopName { get; set; } = default!;
+
+    [CommandOption("--type")]
+    [Description("The nic port type e.g rj45 / sfp+")]
+    public string? Type { get; set; }
+
+    [CommandOption("--speed")]
+    [Description("The port speed.")]
+    public double? Speed { get; set; }
+
+    [CommandOption("--ports")]
+    [Description("The number of ports.")]
+    public int? Ports { get; set; }
+}
+
 public class DesktopNicAddCommand(IServiceProvider provider)
     : AsyncCommand<DesktopNicAddSettings>
 {

+ 0 - 23
Shared.Rcl/Commands/Desktops/Nics/DesktopNicAddSettings.cs

@@ -1,23 +0,0 @@
-using System.ComponentModel;
-using Spectre.Console.Cli;
-
-namespace Shared.Rcl.Commands.Desktops.Nics;
-
-public class DesktopNicAddSettings : CommandSettings
-{
-    [CommandArgument(0, "<desktop>")]
-    [Description("The desktop name.")]
-    public string DesktopName { get; set; } = default!;
-
-    [CommandOption("--type")]
-    [Description("The nic port type e.g rj45 / sfp+")]
-    public string? Type { get; set; }
-
-    [CommandOption("--speed")]
-    [Description("The port speed.")]
-    public int? Speed { get; set; }
-
-    [CommandOption("--ports")]
-    [Description("The number of ports.")]
-    public int? Ports { get; set; }
-}

+ 12 - 0
Shared.Rcl/Commands/Desktops/Nics/DesktopNicRemoveCommand.cs

@@ -1,3 +1,4 @@
+using System.ComponentModel;
 using Microsoft.Extensions.DependencyInjection;
 using RackPeek.Domain.Resources.Desktops;
 using RackPeek.Domain.UseCases.Nics;
@@ -6,6 +7,17 @@ using Spectre.Console.Cli;
 
 namespace Shared.Rcl.Commands.Desktops.Nics;
 
+public class DesktopNicRemoveSettings : CommandSettings
+{
+    [CommandArgument(0, "<desktop>")]
+    [Description("The desktop name.")]
+    public string DesktopName { get; set; } = default!;
+
+    [CommandArgument(1, "<index>")]
+    [Description("The index of the nic to remove.")]
+    public int Index { get; set; }
+}
+
 public class DesktopNicRemoveCommand(IServiceProvider provider)
     : AsyncCommand<DesktopNicRemoveSettings>
 {

+ 0 - 15
Shared.Rcl/Commands/Desktops/Nics/DesktopNicRemoveSettings.cs

@@ -1,15 +0,0 @@
-using System.ComponentModel;
-using Spectre.Console.Cli;
-
-namespace Shared.Rcl.Commands.Desktops.Nics;
-
-public class DesktopNicRemoveSettings : CommandSettings
-{
-    [CommandArgument(0, "<desktop>")]
-    [Description("The desktop name.")]
-    public string DesktopName { get; set; } = default!;
-
-    [CommandArgument(1, "<index>")]
-    [Description("The index of the nic to remove.")]
-    public int Index { get; set; }
-}

+ 24 - 0
Shared.Rcl/Commands/Desktops/Nics/DesktopNicSetCommand.cs

@@ -1,3 +1,4 @@
+using System.ComponentModel;
 using Microsoft.Extensions.DependencyInjection;
 using RackPeek.Domain.Resources.Desktops;
 using RackPeek.Domain.UseCases.Nics;
@@ -6,6 +7,29 @@ using Spectre.Console.Cli;
 
 namespace Shared.Rcl.Commands.Desktops.Nics;
 
+public class DesktopNicSetSettings : CommandSettings
+{
+    [CommandArgument(0, "<desktop>")]
+    [Description("The desktop name.")]
+    public string DesktopName { get; set; } = default!;
+
+    [CommandArgument(1, "<index>")]
+    [Description("The index of the nic to remove.")]
+    public int Index { get; set; }
+
+    [CommandOption("--type")]
+    [Description("The nic port type e.g rj45 / sfp+")]
+    public string? Type { get; set; }
+
+    [CommandOption("--speed")]
+    [Description("The speed of the nic in Gb/s.")]
+    public int? Speed { get; set; }
+
+    [CommandOption("--ports")]
+    [Description("The number of ports.")]
+    public int? Ports { get; set; }
+}
+
 public class DesktopNicSetCommand(IServiceProvider provider)
     : AsyncCommand<DesktopNicSetSettings>
 {

+ 0 - 27
Shared.Rcl/Commands/Desktops/Nics/DesktopNicSetSettings.cs

@@ -1,27 +0,0 @@
-using System.ComponentModel;
-using Spectre.Console.Cli;
-
-namespace Shared.Rcl.Commands.Desktops.Nics;
-
-public class DesktopNicSetSettings : CommandSettings
-{
-    [CommandArgument(0, "<desktop>")]
-    [Description("The desktop name.")]
-    public string DesktopName { get; set; } = default!;
-
-    [CommandArgument(1, "<index>")]
-    [Description("The index of the nic to remove.")]
-    public int Index { get; set; }
-
-    [CommandOption("--type")]
-    [Description("The nic port type e.g rj45 / sfp+")]
-    public string? Type { get; set; }
-
-    [CommandOption("--speed")]
-    [Description("The speed of the nic in Gb/s.")]
-    public int? Speed { get; set; }
-
-    [CommandOption("--ports")]
-    [Description("The number of ports.")]
-    public int? Ports { get; set; }
-}

+ 3 - 2
Shared.Rcl/Commands/Firewalls/Labels/FirewallLabelAddCommand.cs

@@ -14,7 +14,8 @@ public class FirewallLabelAddSettings : FirewallNameSettings
 
 public class FirewallLabelAddCommand(IServiceProvider serviceProvider) : AsyncCommand<FirewallLabelAddSettings>
 {
-    public override async Task<int> ExecuteAsync(CommandContext context, FirewallLabelAddSettings settings, CancellationToken cancellationToken)
+    public override async Task<int> ExecuteAsync(CommandContext context, FirewallLabelAddSettings settings,
+        CancellationToken cancellationToken)
     {
         using var scope = serviceProvider.CreateScope();
         var useCase = scope.ServiceProvider.GetRequiredService<IAddLabelUseCase<Firewall>>();
@@ -22,4 +23,4 @@ public class FirewallLabelAddCommand(IServiceProvider serviceProvider) : AsyncCo
         AnsiConsole.MarkupLine($"[green]Label '{settings.Key}' added to '{settings.Name}'.[/]");
         return 0;
     }
-}
+}

+ 3 - 2
Shared.Rcl/Commands/Firewalls/Labels/FirewallLabelRemoveCommand.cs

@@ -13,7 +13,8 @@ public class FirewallLabelRemoveSettings : FirewallNameSettings
 
 public class FirewallLabelRemoveCommand(IServiceProvider serviceProvider) : AsyncCommand<FirewallLabelRemoveSettings>
 {
-    public override async Task<int> ExecuteAsync(CommandContext context, FirewallLabelRemoveSettings settings, CancellationToken cancellationToken)
+    public override async Task<int> ExecuteAsync(CommandContext context, FirewallLabelRemoveSettings settings,
+        CancellationToken cancellationToken)
     {
         using var scope = serviceProvider.CreateScope();
         var useCase = scope.ServiceProvider.GetRequiredService<IRemoveLabelUseCase<Firewall>>();
@@ -21,4 +22,4 @@ public class FirewallLabelRemoveCommand(IServiceProvider serviceProvider) : Asyn
         AnsiConsole.MarkupLine($"[green]Label '{settings.Key}' removed from '{settings.Name}'.[/]");
         return 0;
     }
-}
+}

+ 20 - 0
Shared.Rcl/Commands/Laptops/Cpus/LaptopCpuAddCommand.cs

@@ -1,3 +1,4 @@
+using System.ComponentModel;
 using Microsoft.Extensions.DependencyInjection;
 using RackPeek.Domain.Resources.Laptops;
 using RackPeek.Domain.UseCases.Cpus;
@@ -6,6 +7,25 @@ using Spectre.Console.Cli;
 
 namespace Shared.Rcl.Commands.Laptops.Cpus;
 
+public class LaptopCpuAddSettings : CommandSettings
+{
+    [CommandArgument(0, "<Laptop>")]
+    [Description("The Laptop name.")]
+    public string LaptopName { get; set; } = default!;
+
+    [CommandOption("--model")]
+    [Description("The model name.")]
+    public string? Model { get; set; }
+
+    [CommandOption("--cores")]
+    [Description("The number of cpu cores.")]
+    public int? Cores { get; set; }
+
+    [CommandOption("--threads")]
+    [Description("The number of cpu threads.")]
+    public int? Threads { get; set; }
+}
+
 public class LaptopCpuAddCommand(IServiceProvider provider)
     : AsyncCommand<LaptopCpuAddSettings>
 {

+ 0 - 23
Shared.Rcl/Commands/Laptops/Cpus/LaptopCpuAddSettings.cs

@@ -1,23 +0,0 @@
-using System.ComponentModel;
-using Spectre.Console.Cli;
-
-namespace Shared.Rcl.Commands.Laptops.Cpus;
-
-public class LaptopCpuAddSettings : CommandSettings
-{
-    [CommandArgument(0, "<Laptop>")]
-    [Description("The Laptop name.")]
-    public string LaptopName { get; set; } = default!;
-
-    [CommandOption("--model")]
-    [Description("The model name.")]
-    public string? Model { get; set; }
-
-    [CommandOption("--cores")]
-    [Description("The number of cpu cores.")]
-    public int? Cores { get; set; }
-
-    [CommandOption("--threads")]
-    [Description("The number of cpu threads.")]
-    public int? Threads { get; set; }
-}

+ 12 - 0
Shared.Rcl/Commands/Laptops/Cpus/LaptopCpuRemoveCommand.cs

@@ -1,3 +1,4 @@
+using System.ComponentModel;
 using Microsoft.Extensions.DependencyInjection;
 using RackPeek.Domain.Resources.Laptops;
 using RackPeek.Domain.UseCases.Cpus;
@@ -6,6 +7,17 @@ using Spectre.Console.Cli;
 
 namespace Shared.Rcl.Commands.Laptops.Cpus;
 
+public class LaptopCpuRemoveSettings : CommandSettings
+{
+    [CommandArgument(0, "<Laptop>")]
+    [Description("The name of the Laptop.")]
+    public string LaptopName { get; set; } = default!;
+
+    [CommandArgument(1, "<index>")]
+    [Description("The index of the Laptop cpu to remove.")]
+    public int Index { get; set; }
+}
+
 public class LaptopCpuRemoveCommand(IServiceProvider provider)
     : AsyncCommand<LaptopCpuRemoveSettings>
 {

+ 0 - 15
Shared.Rcl/Commands/Laptops/Cpus/LaptopCpuRemoveSettings.cs

@@ -1,15 +0,0 @@
-using System.ComponentModel;
-using Spectre.Console.Cli;
-
-namespace Shared.Rcl.Commands.Laptops.Cpus;
-
-public class LaptopCpuRemoveSettings : CommandSettings
-{
-    [CommandArgument(0, "<Laptop>")]
-    [Description("The name of the Laptop.")]
-    public string LaptopName { get; set; } = default!;
-
-    [CommandArgument(1, "<index>")]
-    [Description("The index of the Laptop cpu to remove.")]
-    public int Index { get; set; }
-}

+ 24 - 0
Shared.Rcl/Commands/Laptops/Cpus/LaptopCpuSetCommand.cs

@@ -1,3 +1,4 @@
+using System.ComponentModel;
 using Microsoft.Extensions.DependencyInjection;
 using RackPeek.Domain.Resources.Laptops;
 using RackPeek.Domain.UseCases.Cpus;
@@ -6,6 +7,29 @@ using Spectre.Console.Cli;
 
 namespace Shared.Rcl.Commands.Laptops.Cpus;
 
+public class LaptopCpuSetSettings : CommandSettings
+{
+    [CommandArgument(0, "<Laptop>")]
+    [Description("The Laptop name.")]
+    public string LaptopName { get; set; } = default!;
+
+    [CommandArgument(1, "<index>")]
+    [Description("The index of the Laptop cpu.")]
+    public int Index { get; set; }
+
+    [CommandOption("--model")]
+    [Description("The cpu model.")]
+    public string? Model { get; set; }
+
+    [CommandOption("--cores")]
+    [Description("The number of cpu cores.")]
+    public int? Cores { get; set; }
+
+    [CommandOption("--threads")]
+    [Description("The number of cpu threads.")]
+    public int? Threads { get; set; }
+}
+
 public class LaptopCpuSetCommand(IServiceProvider provider)
     : AsyncCommand<LaptopCpuSetSettings>
 {

+ 0 - 27
Shared.Rcl/Commands/Laptops/Cpus/LaptopCpuSetSettings.cs

@@ -1,27 +0,0 @@
-using System.ComponentModel;
-using Spectre.Console.Cli;
-
-namespace Shared.Rcl.Commands.Laptops.Cpus;
-
-public class LaptopCpuSetSettings : CommandSettings
-{
-    [CommandArgument(0, "<Laptop>")]
-    [Description("The Laptop name.")]
-    public string LaptopName { get; set; } = default!;
-
-    [CommandArgument(1, "<index>")]
-    [Description("The index of the Laptop cpu.")]
-    public int Index { get; set; }
-
-    [CommandOption("--model")]
-    [Description("The cpu model.")]
-    public string? Model { get; set; }
-
-    [CommandOption("--cores")]
-    [Description("The number of cpu cores.")]
-    public int? Cores { get; set; }
-
-    [CommandOption("--threads")]
-    [Description("The number of cpu threads.")]
-    public int? Threads { get; set; }
-}

+ 3 - 2
Shared.Rcl/Commands/Laptops/Labels/LaptopLabelAddCommand.cs

@@ -14,7 +14,8 @@ public class LaptopLabelAddSettings : LaptopNameSettings
 
 public class LaptopLabelAddCommand(IServiceProvider serviceProvider) : AsyncCommand<LaptopLabelAddSettings>
 {
-    public override async Task<int> ExecuteAsync(CommandContext context, LaptopLabelAddSettings settings, CancellationToken cancellationToken)
+    public override async Task<int> ExecuteAsync(CommandContext context, LaptopLabelAddSettings settings,
+        CancellationToken cancellationToken)
     {
         using var scope = serviceProvider.CreateScope();
         var useCase = scope.ServiceProvider.GetRequiredService<IAddLabelUseCase<Laptop>>();
@@ -22,4 +23,4 @@ public class LaptopLabelAddCommand(IServiceProvider serviceProvider) : AsyncComm
         AnsiConsole.MarkupLine($"[green]Label '{settings.Key}' added to '{settings.Name}'.[/]");
         return 0;
     }
-}
+}

+ 3 - 2
Shared.Rcl/Commands/Laptops/Labels/LaptopLabelRemoveCommand.cs

@@ -13,7 +13,8 @@ public class LaptopLabelRemoveSettings : LaptopNameSettings
 
 public class LaptopLabelRemoveCommand(IServiceProvider serviceProvider) : AsyncCommand<LaptopLabelRemoveSettings>
 {
-    public override async Task<int> ExecuteAsync(CommandContext context, LaptopLabelRemoveSettings settings, CancellationToken cancellationToken)
+    public override async Task<int> ExecuteAsync(CommandContext context, LaptopLabelRemoveSettings settings,
+        CancellationToken cancellationToken)
     {
         using var scope = serviceProvider.CreateScope();
         var useCase = scope.ServiceProvider.GetRequiredService<IRemoveLabelUseCase<Laptop>>();
@@ -21,4 +22,4 @@ public class LaptopLabelRemoveCommand(IServiceProvider serviceProvider) : AsyncC
         AnsiConsole.MarkupLine($"[green]Label '{settings.Key}' removed from '{settings.Name}'.[/]");
         return 0;
     }
-}
+}

+ 3 - 2
Shared.Rcl/Commands/Routers/Labels/RouterLabelAddCommand.cs

@@ -14,7 +14,8 @@ public class RouterLabelAddSettings : RouterNameSettings
 
 public class RouterLabelAddCommand(IServiceProvider serviceProvider) : AsyncCommand<RouterLabelAddSettings>
 {
-    public override async Task<int> ExecuteAsync(CommandContext context, RouterLabelAddSettings settings, CancellationToken cancellationToken)
+    public override async Task<int> ExecuteAsync(CommandContext context, RouterLabelAddSettings settings,
+        CancellationToken cancellationToken)
     {
         using var scope = serviceProvider.CreateScope();
         var useCase = scope.ServiceProvider.GetRequiredService<IAddLabelUseCase<Router>>();
@@ -22,4 +23,4 @@ public class RouterLabelAddCommand(IServiceProvider serviceProvider) : AsyncComm
         AnsiConsole.MarkupLine($"[green]Label '{settings.Key}' added to '{settings.Name}'.[/]");
         return 0;
     }
-}
+}

+ 3 - 2
Shared.Rcl/Commands/Routers/Labels/RouterLabelRemoveCommand.cs

@@ -13,7 +13,8 @@ public class RouterLabelRemoveSettings : RouterNameSettings
 
 public class RouterLabelRemoveCommand(IServiceProvider serviceProvider) : AsyncCommand<RouterLabelRemoveSettings>
 {
-    public override async Task<int> ExecuteAsync(CommandContext context, RouterLabelRemoveSettings settings, CancellationToken cancellationToken)
+    public override async Task<int> ExecuteAsync(CommandContext context, RouterLabelRemoveSettings settings,
+        CancellationToken cancellationToken)
     {
         using var scope = serviceProvider.CreateScope();
         var useCase = scope.ServiceProvider.GetRequiredService<IRemoveLabelUseCase<Router>>();
@@ -21,4 +22,4 @@ public class RouterLabelRemoveCommand(IServiceProvider serviceProvider) : AsyncC
         AnsiConsole.MarkupLine($"[green]Label '{settings.Key}' removed from '{settings.Name}'.[/]");
         return 0;
     }
-}
+}

+ 3 - 5
Shared.Rcl/Commands/Servers/Labels/ServerLabelAddCommand.cs

@@ -8,11 +8,9 @@ namespace Shared.Rcl.Commands.Servers.Labels;
 
 public class ServerLabelAddSettings : ServerNameSettings
 {
-    [CommandOption("--key <KEY>")]
-    public string Key { get; set; } = default!;
+    [CommandOption("--key <KEY>")] public string Key { get; set; } = default!;
 
-    [CommandOption("--value <VALUE>")]
-    public string Value { get; set; } = default!;
+    [CommandOption("--value <VALUE>")] public string Value { get; set; } = default!;
 }
 
 public class ServerLabelAddCommand(IServiceProvider serviceProvider)
@@ -31,4 +29,4 @@ public class ServerLabelAddCommand(IServiceProvider serviceProvider)
         AnsiConsole.MarkupLine($"[green]Label '{settings.Key}' added to '{settings.Name}'.[/]");
         return 0;
     }
-}
+}

+ 2 - 3
Shared.Rcl/Commands/Servers/Labels/ServerLabelRemoveCommand.cs

@@ -8,8 +8,7 @@ namespace Shared.Rcl.Commands.Servers.Labels;
 
 public class ServerLabelRemoveSettings : ServerNameSettings
 {
-    [CommandOption("--key <KEY>")]
-    public string Key { get; set; } = default!;
+    [CommandOption("--key <KEY>")] public string Key { get; set; } = default!;
 }
 
 public class ServerLabelRemoveCommand(IServiceProvider serviceProvider)
@@ -28,4 +27,4 @@ public class ServerLabelRemoveCommand(IServiceProvider serviceProvider)
         AnsiConsole.MarkupLine($"[green]Label '{settings.Key}' removed from '{settings.Name}'.[/]");
         return 0;
     }
-}
+}

+ 3 - 2
Shared.Rcl/Commands/Services/Labels/ServiceLabelAddCommand.cs

@@ -14,7 +14,8 @@ public class ServiceLabelAddSettings : ServiceNameSettings
 
 public class ServiceLabelAddCommand(IServiceProvider serviceProvider) : AsyncCommand<ServiceLabelAddSettings>
 {
-    public override async Task<int> ExecuteAsync(CommandContext context, ServiceLabelAddSettings settings, CancellationToken cancellationToken)
+    public override async Task<int> ExecuteAsync(CommandContext context, ServiceLabelAddSettings settings,
+        CancellationToken cancellationToken)
     {
         using var scope = serviceProvider.CreateScope();
         var useCase = scope.ServiceProvider.GetRequiredService<IAddLabelUseCase<Service>>();
@@ -22,4 +23,4 @@ public class ServiceLabelAddCommand(IServiceProvider serviceProvider) : AsyncCom
         AnsiConsole.MarkupLine($"[green]Label '{settings.Key}' added to '{settings.Name}'.[/]");
         return 0;
     }
-}
+}

+ 3 - 2
Shared.Rcl/Commands/Services/Labels/ServiceLabelRemoveCommand.cs

@@ -13,7 +13,8 @@ public class ServiceLabelRemoveSettings : ServiceNameSettings
 
 public class ServiceLabelRemoveCommand(IServiceProvider serviceProvider) : AsyncCommand<ServiceLabelRemoveSettings>
 {
-    public override async Task<int> ExecuteAsync(CommandContext context, ServiceLabelRemoveSettings settings, CancellationToken cancellationToken)
+    public override async Task<int> ExecuteAsync(CommandContext context, ServiceLabelRemoveSettings settings,
+        CancellationToken cancellationToken)
     {
         using var scope = serviceProvider.CreateScope();
         var useCase = scope.ServiceProvider.GetRequiredService<IRemoveLabelUseCase<Service>>();
@@ -21,4 +22,4 @@ public class ServiceLabelRemoveCommand(IServiceProvider serviceProvider) : Async
         AnsiConsole.MarkupLine($"[green]Label '{settings.Key}' removed from '{settings.Name}'.[/]");
         return 0;
     }
-}
+}

+ 3 - 2
Shared.Rcl/Commands/Services/ServiceDescribeCommand.cs

@@ -33,7 +33,8 @@ public class ServiceDescribeCommand(
         grid.AddRow("Protocol:", service.Protocol ?? "Unknown");
         grid.AddRow("Url:", service.Url ?? "Unknown");
         grid.AddRow("Runs On:",
-            ServicesFormatExtensions.FormatRunsOn(string.Join(", ", service.RunsOnSystemHost), string.Join(", ", service.RunsOnPhysicalHost)));
+            ServicesFormatExtensions.FormatRunsOn(string.Join(", ", service.RunsOnSystemHost),
+                string.Join(", ", service.RunsOnPhysicalHost)));
 
         if (service.Labels.Count > 0)
             grid.AddRow("Labels:", string.Join(", ", service.Labels.Select(kvp => $"{kvp.Key}: {kvp.Value}")));
@@ -45,4 +46,4 @@ public class ServiceDescribeCommand(
 
         return 0;
     }
-}
+}

+ 1 - 1
Shared.Rcl/Commands/Services/ServiceGetByNameCommand.cs

@@ -26,4 +26,4 @@ public class ServiceGetByNameCommand(
             $"[green]{service.Name}[/]  Ip: {service.Ip ?? "Unknown"}, Port: {service.Port.ToString() ?? "Unknown"}, Protocol: {service.Protocol ?? "Unknown"}, Url: {service.Url ?? "Unknown"}, RunsOn: {ServicesFormatExtensions.FormatRunsOn(sys, phys)}");
         return 0;
     }
-}
+}

+ 4 - 10
Shared.Rcl/Commands/Services/ServiceGetCommand.cs

@@ -37,15 +37,9 @@ public class ServiceGetCommand(
         {
             string? sys = null;
             string? phys = null;
-            
-            if (s.RunsOnSystemHost is not null)
-            {
-                sys = string.Join(", ", s.RunsOnSystemHost);
-            }
-            if (s.RunsOnPhysicalHost is not null)
-            {
-                phys = string.Join(", ", s.RunsOnPhysicalHost);
-            }
+
+            if (s.RunsOnSystemHost is not null) sys = string.Join(", ", s.RunsOnSystemHost);
+            if (s.RunsOnPhysicalHost is not null) phys = string.Join(", ", s.RunsOnPhysicalHost);
 
             table.AddRow(
                 s.Name,
@@ -60,4 +54,4 @@ public class ServiceGetCommand(
         AnsiConsole.Write(table);
         return 0;
     }
-}
+}

+ 3 - 9
Shared.Rcl/Commands/Services/ServiceReportCommand.cs

@@ -38,14 +38,8 @@ public class ServiceReportCommand(
             string? sys = null;
             string? phys = null;
 
-            if (s.RunsOnSystemHost?.Count > 0 )
-            {
-                sys = string.Join(", ", s.RunsOnSystemHost);
-            }
-            if (s.RunsOnPhysicalHost?.Count > 0 )
-            {
-                phys = string.Join(", ", s.RunsOnPhysicalHost);
-            }
+            if (s.RunsOnSystemHost?.Count > 0) sys = string.Join(", ", s.RunsOnSystemHost);
+            if (s.RunsOnPhysicalHost?.Count > 0) phys = string.Join(", ", s.RunsOnPhysicalHost);
 
             table.AddRow(
                 s.Name,
@@ -60,4 +54,4 @@ public class ServiceReportCommand(
         AnsiConsole.Write(table);
         return 0;
     }
-}
+}

+ 1 - 1
Shared.Rcl/Commands/Services/ServiceSetCommand.cs

@@ -54,4 +54,4 @@ public class ServiceSetCommand(
         AnsiConsole.MarkupLine($"[green]Service '{settings.Name}' updated.[/]");
         return 0;
     }
-}
+}

+ 2 - 5
Shared.Rcl/Commands/Services/ServiceSubnetsCommand.cs

@@ -81,10 +81,7 @@ public class ServiceSubnetsCommand(
             foreach (var s in services)
             {
                 var runsOn = "";
-                if (s.RunsOn?.Count > 0)
-                {
-                    runsOn = string.Join(", ", s.RunsOn);
-                }
+                if (s.RunsOn?.Count > 0) runsOn = string.Join(", ", s.RunsOn);
 
                 table.AddRow(s.Name, s.Ip, runsOn);
             }
@@ -145,4 +142,4 @@ public class ServiceSubnetsCommand(
 
         [CommandOption("--prefix <PREFIX>")] public int? Prefix { get; set; }
     }
-}
+}

+ 3 - 2
Shared.Rcl/Commands/Switches/Labels/SwitchLabelAddCommand.cs

@@ -14,7 +14,8 @@ public class SwitchLabelAddSettings : SwitchNameSettings
 
 public class SwitchLabelAddCommand(IServiceProvider serviceProvider) : AsyncCommand<SwitchLabelAddSettings>
 {
-    public override async Task<int> ExecuteAsync(CommandContext context, SwitchLabelAddSettings settings, CancellationToken cancellationToken)
+    public override async Task<int> ExecuteAsync(CommandContext context, SwitchLabelAddSettings settings,
+        CancellationToken cancellationToken)
     {
         using var scope = serviceProvider.CreateScope();
         var useCase = scope.ServiceProvider.GetRequiredService<IAddLabelUseCase<Switch>>();
@@ -22,4 +23,4 @@ public class SwitchLabelAddCommand(IServiceProvider serviceProvider) : AsyncComm
         AnsiConsole.MarkupLine($"[green]Label '{settings.Key}' added to '{settings.Name}'.[/]");
         return 0;
     }
-}
+}

+ 3 - 2
Shared.Rcl/Commands/Switches/Labels/SwitchLabelRemoveCommand.cs

@@ -13,7 +13,8 @@ public class SwitchLabelRemoveSettings : SwitchNameSettings
 
 public class SwitchLabelRemoveCommand(IServiceProvider serviceProvider) : AsyncCommand<SwitchLabelRemoveSettings>
 {
-    public override async Task<int> ExecuteAsync(CommandContext context, SwitchLabelRemoveSettings settings, CancellationToken cancellationToken)
+    public override async Task<int> ExecuteAsync(CommandContext context, SwitchLabelRemoveSettings settings,
+        CancellationToken cancellationToken)
     {
         using var scope = serviceProvider.CreateScope();
         var useCase = scope.ServiceProvider.GetRequiredService<IRemoveLabelUseCase<Switch>>();
@@ -21,4 +22,4 @@ public class SwitchLabelRemoveCommand(IServiceProvider serviceProvider) : AsyncC
         AnsiConsole.MarkupLine($"[green]Label '{settings.Key}' removed from '{settings.Name}'.[/]");
         return 0;
     }
-}
+}

+ 3 - 2
Shared.Rcl/Commands/Systems/Labels/SystemLabelAddCommand.cs

@@ -14,7 +14,8 @@ public class SystemLabelAddSettings : SystemNameSettings
 
 public class SystemLabelAddCommand(IServiceProvider serviceProvider) : AsyncCommand<SystemLabelAddSettings>
 {
-    public override async Task<int> ExecuteAsync(CommandContext context, SystemLabelAddSettings settings, CancellationToken cancellationToken)
+    public override async Task<int> ExecuteAsync(CommandContext context, SystemLabelAddSettings settings,
+        CancellationToken cancellationToken)
     {
         using var scope = serviceProvider.CreateScope();
         var useCase = scope.ServiceProvider.GetRequiredService<IAddLabelUseCase<SystemResource>>();
@@ -22,4 +23,4 @@ public class SystemLabelAddCommand(IServiceProvider serviceProvider) : AsyncComm
         AnsiConsole.MarkupLine($"[green]Label '{settings.Key}' added to '{settings.Name}'.[/]");
         return 0;
     }
-}
+}

+ 3 - 2
Shared.Rcl/Commands/Systems/Labels/SystemLabelRemoveCommand.cs

@@ -13,7 +13,8 @@ public class SystemLabelRemoveSettings : SystemNameSettings
 
 public class SystemLabelRemoveCommand(IServiceProvider serviceProvider) : AsyncCommand<SystemLabelRemoveSettings>
 {
-    public override async Task<int> ExecuteAsync(CommandContext context, SystemLabelRemoveSettings settings, CancellationToken cancellationToken)
+    public override async Task<int> ExecuteAsync(CommandContext context, SystemLabelRemoveSettings settings,
+        CancellationToken cancellationToken)
     {
         using var scope = serviceProvider.CreateScope();
         var useCase = scope.ServiceProvider.GetRequiredService<IRemoveLabelUseCase<SystemResource>>();
@@ -21,4 +22,4 @@ public class SystemLabelRemoveCommand(IServiceProvider serviceProvider) : AsyncC
         AnsiConsole.MarkupLine($"[green]Label '{settings.Key}' removed from '{settings.Name}'.[/]");
         return 0;
     }
-}
+}

+ 2 - 2
Shared.Rcl/Commands/Systems/SystemDescribeCommand.cs

@@ -30,7 +30,7 @@ public class SystemDescribeCommand(
         grid.AddRow("RAM (GB):", system.RamGb.ToString());
         grid.AddRow("Total Storage (GB):", system.TotalStorageGb.ToString());
         grid.AddRow("Runs On:", string.Join(", ", system.RunsOn) ?? "Unknown");
-                
+
 
         if (system.Labels.Count > 0)
             grid.AddRow("Labels:", string.Join(", ", system.Labels.Select(kvp => $"{kvp.Key}: {kvp.Value}")));
@@ -42,4 +42,4 @@ public class SystemDescribeCommand(
 
         return 0;
     }
-}
+}

+ 1 - 1
Shared.Rcl/Commands/Systems/SystemGetByNameCommand.cs

@@ -24,4 +24,4 @@ public class SystemGetByNameCommand(
 
         return 0;
     }
-}
+}

+ 1 - 1
Shared.Rcl/Commands/Systems/SystemGetCommand.cs

@@ -48,4 +48,4 @@ public class SystemGetCommand(
         AnsiConsole.Write(table);
         return 0;
     }
-}
+}

+ 1 - 1
Shared.Rcl/Commands/Systems/SystemReportCommand.cs

@@ -48,4 +48,4 @@ public class SystemReportCommand(
         AnsiConsole.Write(table);
         return 0;
     }
-}
+}

+ 1 - 2
Shared.Rcl/Commands/Systems/SystemSetCommand.cs

@@ -20,7 +20,6 @@ public class SystemSetSettings : ServerNameSettings
     [CommandOption("--runs-on <RUNSON>")]
     [Description("The physical machine(s) the service is running on.")]
     public string[]? RunsOn { get; set; }
-    
 }
 
 public class SystemSetCommand(
@@ -47,4 +46,4 @@ public class SystemSetCommand(
         AnsiConsole.MarkupLine($"[green]System '{settings.Name}' updated.[/]");
         return 0;
     }
-}
+}

+ 4 - 3
Shared.Rcl/Commands/Ups/Labels/UpsLabelAddCommand.cs

@@ -1,8 +1,8 @@
 using Microsoft.Extensions.DependencyInjection;
-using UpsUnit = RackPeek.Domain.Resources.UpsUnits.Ups;
 using RackPeek.Domain.UseCases.Labels;
 using Spectre.Console;
 using Spectre.Console.Cli;
+using UpsUnit = RackPeek.Domain.Resources.UpsUnits.Ups;
 
 namespace Shared.Rcl.Commands.Ups.Labels;
 
@@ -14,7 +14,8 @@ public class UpsLabelAddSettings : UpsNameSettings
 
 public class UpsLabelAddCommand(IServiceProvider serviceProvider) : AsyncCommand<UpsLabelAddSettings>
 {
-    public override async Task<int> ExecuteAsync(CommandContext context, UpsLabelAddSettings settings, CancellationToken cancellationToken)
+    public override async Task<int> ExecuteAsync(CommandContext context, UpsLabelAddSettings settings,
+        CancellationToken cancellationToken)
     {
         using var scope = serviceProvider.CreateScope();
         var useCase = scope.ServiceProvider.GetRequiredService<IAddLabelUseCase<UpsUnit>>();
@@ -22,4 +23,4 @@ public class UpsLabelAddCommand(IServiceProvider serviceProvider) : AsyncCommand
         AnsiConsole.MarkupLine($"[green]Label '{settings.Key}' added to '{settings.Name}'.[/]");
         return 0;
     }
-}
+}

+ 4 - 3
Shared.Rcl/Commands/Ups/Labels/UpsLabelRemoveCommand.cs

@@ -1,8 +1,8 @@
 using Microsoft.Extensions.DependencyInjection;
-using UpsUnit = RackPeek.Domain.Resources.UpsUnits.Ups;
 using RackPeek.Domain.UseCases.Labels;
 using Spectre.Console;
 using Spectre.Console.Cli;
+using UpsUnit = RackPeek.Domain.Resources.UpsUnits.Ups;
 
 namespace Shared.Rcl.Commands.Ups.Labels;
 
@@ -13,7 +13,8 @@ public class UpsLabelRemoveSettings : UpsNameSettings
 
 public class UpsLabelRemoveCommand(IServiceProvider serviceProvider) : AsyncCommand<UpsLabelRemoveSettings>
 {
-    public override async Task<int> ExecuteAsync(CommandContext context, UpsLabelRemoveSettings settings, CancellationToken cancellationToken)
+    public override async Task<int> ExecuteAsync(CommandContext context, UpsLabelRemoveSettings settings,
+        CancellationToken cancellationToken)
     {
         using var scope = serviceProvider.CreateScope();
         var useCase = scope.ServiceProvider.GetRequiredService<IRemoveLabelUseCase<UpsUnit>>();
@@ -21,4 +22,4 @@ public class UpsLabelRemoveCommand(IServiceProvider serviceProvider) : AsyncComm
         AnsiConsole.MarkupLine($"[green]Label '{settings.Key}' removed from '{settings.Name}'.[/]");
         return 0;
     }
-}
+}