Ver Fonte

Fixed laptop commands to make them uniform and added GB to all add drives commands

James há 1 mês atrás
pai
commit
f6fce9a47f

+ 16 - 16
Shared.Rcl/CliBootstrap.cs

@@ -409,24 +409,24 @@ public static class CliBootstrap
             // ----------------------------
             // Laptops
             // ----------------------------
-            config.AddBranch("Laptops", Laptops =>
+            config.AddBranch("laptops", laptops =>
             {
-                Laptops.SetDescription("Manage Laptop computers and their components.");
+                laptops.SetDescription("Manage Laptop computers and their components.");
 
                 // CRUD
-                Laptops.AddCommand<LaptopAddCommand>("add").WithDescription("Add a new Laptop.");
-                Laptops.AddCommand<LaptopGetCommand>("list").WithDescription("List all Laptops.");
-                Laptops.AddCommand<LaptopGetByNameCommand>("get").WithDescription("Retrieve a Laptop by name.");
-                Laptops.AddCommand<LaptopDescribeCommand>("describe")
+                laptops.AddCommand<LaptopAddCommand>("add").WithDescription("Add a new Laptop.");
+                laptops.AddCommand<LaptopGetCommand>("list").WithDescription("List all Laptops.");
+                laptops.AddCommand<LaptopGetByNameCommand>("get").WithDescription("Retrieve a Laptop by name.");
+                laptops.AddCommand<LaptopDescribeCommand>("describe")
                     .WithDescription("Show detailed information about a Laptop.");
-                Laptops.AddCommand<LaptopDeleteCommand>("del").WithDescription("Delete a Laptop from the inventory.");
-                Laptops.AddCommand<LaptopReportCommand>("summary")
+                laptops.AddCommand<LaptopDeleteCommand>("del").WithDescription("Delete a Laptop from the inventory.");
+                laptops.AddCommand<LaptopReportCommand>("summary")
                     .WithDescription("Show a summarized hardware report for all Laptops.");
-                Laptops.AddCommand<LaptopTreeCommand>("tree")
+                laptops.AddCommand<LaptopTreeCommand>("tree")
                     .WithDescription("Display the dependency tree for a Laptop.");
 
                 // CPU
-                Laptops.AddBranch("cpu", cpu =>
+                laptops.AddBranch("cpu", cpu =>
                 {
                     cpu.SetDescription("Manage CPUs attached to Laptops.");
                     cpu.AddCommand<LaptopCpuAddCommand>("add").WithDescription("Add a CPU to a Laptop.");
@@ -435,16 +435,16 @@ public static class CliBootstrap
                 });
 
                 // Drives
-                Laptops.AddBranch("drive", drive =>
+                laptops.AddBranch("drives", drives =>
                 {
-                    drive.SetDescription("Manage storage drives attached to Laptops.");
-                    drive.AddCommand<LaptopDriveAddCommand>("add").WithDescription("Add a drive to a Laptop.");
-                    drive.AddCommand<LaptopDriveSetCommand>("set").WithDescription("Update a Laptop drive.");
-                    drive.AddCommand<LaptopDriveRemoveCommand>("del").WithDescription("Remove a drive from a Laptop.");
+                    drives.SetDescription("Manage storage drives attached to Laptops.");
+                    drives.AddCommand<LaptopDriveAddCommand>("add").WithDescription("Add a drive to a Laptop.");
+                    drives.AddCommand<LaptopDriveSetCommand>("set").WithDescription("Update a Laptop drive.");
+                    drives.AddCommand<LaptopDriveRemoveCommand>("del").WithDescription("Remove a drive from a Laptop.");
                 });
 
                 // GPUs
-                Laptops.AddBranch("gpu", gpu =>
+                laptops.AddBranch("gpu", gpu =>
                 {
                     gpu.SetDescription("Manage GPUs attached to Laptops.");
                     gpu.AddCommand<LaptopGpuAddCommand>("add").WithDescription("Add a GPU to a Laptop.");

+ 1 - 1
Shared.Rcl/Commands/Desktops/Drive/DesktopDriveAddSettings.cs

@@ -14,6 +14,6 @@ public class DesktopDriveAddSettings : CommandSettings
     public string? Type { get; set; }
 
     [CommandOption("--size")]
-    [Description("The drive capacity in Gb.")]
+    [Description("The drive capacity in GB.")]
     public int? Size { get; set; }
 }

+ 2 - 2
Shared.Rcl/Commands/Laptops/Drive/LaptopDriveAddSettings.cs

@@ -5,7 +5,7 @@ namespace RackPeek.Commands.Laptops.Drive;
 
 public class LaptopDriveAddSettings : CommandSettings
 {
-    [CommandArgument(0, "<Laptop>")]
+    [CommandArgument(0, "<laptop>")]
     [Description("The name of the Laptop.")]
     public string LaptopName { get; set; } = default!;
 
@@ -14,6 +14,6 @@ public class LaptopDriveAddSettings : CommandSettings
     public string? Type { get; set; }
 
     [CommandOption("--size")]
-    [Description("The drive capacity in Gb.")]
+    [Description("The drive capacity in GB:.")]
     public int? Size { get; set; }
 }

+ 7 - 2
Shared.Rcl/Commands/Servers/Drives/ServerDriveAddCommand.cs

@@ -1,3 +1,4 @@
+using System.ComponentModel;
 using Microsoft.Extensions.DependencyInjection;
 using RackPeek.Domain.Resources.Hardware.Servers.Drives;
 using Spectre.Console;
@@ -7,9 +8,13 @@ namespace RackPeek.Commands.Servers.Drives;
 
 public class ServerDriveAddSettings : ServerNameSettings
 {
-    [CommandOption("--type <TYPE>")] public string Type { get; set; }
+    [CommandOption("--type <TYPE>")] 
+    [Description("The drive type e.g hdd / ssd.")]
+    public string Type { get; set; }
 
-    [CommandOption("--size <SIZE>")] public int Size { get; set; }
+    [CommandOption("--size <SIZE>")] 
+    [Description("The drive capacity in GB.")]
+    public int Size { get; set; }
 }
 
 public class ServerDriveAddCommand(IServiceProvider serviceProvider)